diff --git a/.github/workflows/visual-regression.yml b/.github/workflows/visual-regression.yml index 4683ada3..eb9015a7 100644 --- a/.github/workflows/visual-regression.yml +++ b/.github/workflows/visual-regression.yml @@ -68,7 +68,7 @@ jobs: } # Tests that crash SwiftShader at high-complexity frames - $exclude = @("Mask_AS2", "Mask_AS3", "MMOPackedRender") + $exclude = @("Mask_AS2", "Mask_AS3", "MMOPackedRender", "FiltersExample") $failed = 0 foreach ($test in $manifest.tests) { $name = $test.name @@ -166,7 +166,7 @@ jobs: python Tests/VisualRegression/compare_reference.py --vulkan-dir Tests/VisualRegression/Output/Captures/vulkan_swiftshader --threshold 16 - --exclude Mask_AS2 Mask_AS3 MMOPackedRender + --exclude Mask_AS2 Mask_AS3 MMOPackedRender FiltersExample - name: Upload captures on failure if: failure() diff --git a/3rdParty/cri/Durango/include/cri_allocator.h b/3rdParty/cri/Durango/include/cri_allocator.h new file mode 100644 index 00000000..e3c18997 --- /dev/null +++ b/3rdParty/cri/Durango/include/cri_allocator.h @@ -0,0 +1,63 @@ +#ifndef _CRI_ALLOCATOR_H_INCLUDED +#define _CRI_ALLOCATOR_H_INCLUDED +/**************************************************************************** + * * + * CRI Allocator * + * * + * 2006-01-05 written by M.Oshimi * + * * + ****************************************************************************/ + +/**************************************************************************** + * Include file + ****************************************************************************/ +#include +#include "cri_xpt.h" +#include "cri_heap.h" + +/**************************************************************************** + * Macro Constants + ****************************************************************************/ +#if defined(XPT_UNSUPPORT_CPLUSPLUS_THROW) +#define CRI_ALLOCATOR_CPLUSPLUS_THROW +#else +#define CRI_ALLOCATOR_CPLUSPLUS_THROW throw() +#endif + +/**************************************************************************** + * Class Declaration + ****************************************************************************/ +#ifdef __cplusplus + +class CriAllocator +{ +public: + static const CriSint32 DEFAULT_ALIGNMENT = CRIHEAP_DEFAULT_MEM_ALIGN; + + + static void* CRIAPI operator new(size_t size, CriHeap heap) CRI_ALLOCATOR_CPLUSPLUS_THROW; + static void* CRIAPI operator new(size_t size, CriHeap heap, CriHeapType heap_type) CRI_ALLOCATOR_CPLUSPLUS_THROW; + static void* CRIAPI operator new(size_t size, CriHeap heap, const CriChar8 *name, CriUint32 align=DEFAULT_ALIGNMENT) CRI_ALLOCATOR_CPLUSPLUS_THROW; + static void* CRIAPI operator new(size_t size, CriHeap heap, CriHeapType heap_type, const CriChar8 *name, CriUint32 align=DEFAULT_ALIGNMENT) CRI_ALLOCATOR_CPLUSPLUS_THROW; + + static void CRIAPI operator delete(void *p, size_t size); + + static void* CRIAPI operator new(size_t size, void *work, CriSint32 wksize) CRI_ALLOCATOR_CPLUSPLUS_THROW; + static void CRIAPI operator delete(void *p, void *work, CriSint32 wksize) CRI_ALLOCATOR_CPLUSPLUS_THROW; + static void* CRIAPI operator new(size_t size, void *work, CriSint32 wksize, CriUint32 align) CRI_ALLOCATOR_CPLUSPLUS_THROW; + static void CRIAPI operator delete(void *p, void *work, CriSint32 wksize, CriUint32 align) CRI_ALLOCATOR_CPLUSPLUS_THROW; + +#if !defined(XPT_TGT_BCB) + static void CRIAPI operator delete(void *p, CriHeap heap) CRI_ALLOCATOR_CPLUSPLUS_THROW; + static void CRIAPI operator delete(void *p, CriHeap heap, CriHeapType heap_type) CRI_ALLOCATOR_CPLUSPLUS_THROW; + static void CRIAPI operator delete(void *p, CriHeap heap, const CriChar8 *name, CriUint32 align) CRI_ALLOCATOR_CPLUSPLUS_THROW; + static void CRIAPI operator delete(void *p, CriHeap heap, CriHeapType heap_type, const CriChar8 *name, CriUint32 align) CRI_ALLOCATOR_CPLUSPLUS_THROW; +#endif + + static CriSint32 GetWorstExtraSize(CriUint32 align); +}; +#endif // _CRI_ALLOCATOR_H_INCLUDED + +#endif /* end of __cplusplus */ + +/* --- end of file --- */ diff --git a/3rdParty/cri/Durango/include/cri_error.h b/3rdParty/cri/Durango/include/cri_error.h new file mode 100644 index 00000000..6fdd5f43 --- /dev/null +++ b/3rdParty/cri/Durango/include/cri_error.h @@ -0,0 +1,368 @@ +#ifndef _CRI_ERROR_H_INCLUDED +#define _CRI_ERROR_H_INCLUDED +/**************************************************************************** + * + * CRI Middleware SDK + * + * Copyright (c) 2006-2009 CRI Middleware Co., Ltd. + * + * Library : CRI Error + * Module : + * File : cri_error.h + * + ****************************************************************************/ +/*! + * \file cri_error.h + */ +/*JP + * \addtogroup CRI_ERROR エラーハンドリング用関数群 + * @{ + */ +/*EN + * \addtogroup CRI_ERROR Functions for error handling + * @{ + */ + +/**************************************************************************** + * Include file * + ****************************************************************************/ +#include "cri_xpt.h" + +/**************************************************************************** + * MACRO CONSTANT * + ****************************************************************************/ + +/* バージョン番号 */ +/* Version number */ +#define CRIERROR_VER_NAME "CRI Error" +#define CRIERROR_VER_NUM "1.04.00" +#define CRIERROR_VER_OPTION + +/*JP + * \brief エラーコード + */ +/*EN + * \brief Error codes + */ +typedef enum { + CRIERR_OK = 0, /*JP< 正常終了 */ + /*EN< Succeeded */ + CRIERR_NG = -1, /*JP< エラーが発生 */ + /*EN< Error occurred */ + CRIERR_INVALID_PARAMETER = -2, /*JP< 引数が不正 */ + /*EN< Invalid argument */ + CRIERR_FAILED_TO_ALLOCATE_MEMORY = -3, /*JP< メモリの確保に失敗 */ + /*EN< Failed to allocate memory */ + CRIERR_UNSAFE_FUNCTION_CALL = -4, /*JP< 非スレッドセーフ関数の並列実行 */ + /*EN< Parallel execution of thread-unsafe function */ + CRIERR_FUNCTION_NOT_IMPLEMENTED = -5, /*JP< 未実装関数の実行 */ + /*EN< Function not implemented */ + CRIERR_LIBRARY_NOT_INITIALIZED = -6, /*JP< ライブラリが未初期化 */ + /*EN< Library not initialized */ + /* enum be 4bytes */ + CRIERR_ENUM_BE_SINT32 = 0x7FFFFFFF +} CriError; + +/*JP + * \brief エラー通知レベル + */ +/*EN + * \brief Error notification level + */ +typedef enum { + CRIERR_NOTIFY_ALL = 0, /*JP< 全てのエラーを通知 */ + /*EN< Notify all errors */ + CRIERR_NOTIFY_FATAL = 1, /*JP< エラーのみ通知(警告は無視) */ + /*EN< Notify error (Disregards warning) */ + /* enum be 4bytes */ + CRIERR_NOTIFY_ENUM_BE_SINT32 = 0x7FFFFFFF +} CriErrorNotificationLevel; + +/* エラーレベル */ +/* Error level */ +typedef enum { + CRIERR_LEVEL_ERROR = 0, + CRIERR_LEVEL_WARNING = 1, + /* enum be 4bytes */ + CRIERR_LEVEL_ENUM_BE_SINT32 = 0x7FFFFFFF +} CriErrorLevel; + +/**************************************************************************** + * PROCESS MACRO * + ****************************************************************************/ + +#if defined(CRIERROR_SIMPLIFY) + /* エラーの通知 */ + /* Notification of Error */ + #define criErr_NotifyError(id, msg) criErr_NotifyErrorSimple() + #define criErr_NotifyError1(id, msg, p1) criErr_NotifyErrorSimple() + #define criErr_NotifyError2(id, msg, p1, p2) criErr_NotifyErrorSimple() + #define criErr_NotifyErrorPrmArray(id, msg, p1, p2, pa) criErr_NotifyErrorSimple() + #define criErr_NotifyErrorGeneric(_error_id, _error_no) criErr_NotifyErrorSimple() + /* 警告の通知 */ + /* Notification of Warning */ + #define criErr_NotifyWarning(id, msg) criErr_NotifyWarningSimple() + #define criErr_NotifyWarning1(id, msg, p1) criErr_NotifyWarningSimple() + #define criErr_NotifyWarning2(id, msg, p1, p2) criErr_NotifyWarningSimple() + #define criErr_NotifyWarningPrmArray(id, msg, p1, p2, pa) criErr_NotifyWarningSimple() + #define criErr_NotifyWarningGeneric(_error_id, _error_no) criErr_NotifyWarningSimple() +#else + /* エラーの通知 */ + /* Notification of Error */ + #define criErr_NotifyError(id, msg) criErr_Notify(CRIERR_LEVEL_ERROR, id ":" msg) + #define criErr_NotifyError1(id, msg, p1) criErr_Notify1(CRIERR_LEVEL_ERROR, (id ":" msg), (CriUintPtr)(p1)) + #define criErr_NotifyError2(id, msg, p1, p2) criErr_Notify2(CRIERR_LEVEL_ERROR, (id ":" msg), (CriUintPtr)(p1), (CriUintPtr)(p2)) + #define criErr_NotifyErrorPrmArray(id, msg, p1, p2, pa) criErr_NotifyPrmArray(CRIERR_LEVEL_ERROR, (id ":" msg), (CriUintPtr)(p1), (CriUintPtr)(p2), (CriUintPtr *)(pa)) + #define criErr_NotifyErrorGeneric(_error_id, _error_no) criErr_NotifyGeneric(CRIERR_LEVEL_ERROR, _error_id, _error_no) + /* 警告の通知 */ + /* Notification of Warning */ + #define criErr_NotifyWarning(id, msg) criErr_Notify(CRIERR_LEVEL_WARNING, id ":" msg) + #define criErr_NotifyWarning1(id, msg, p1) criErr_Notify1(CRIERR_LEVEL_WARNING, (id ":" msg), (CriUintPtr)(p1)) + #define criErr_NotifyWarning2(id, msg, p1, p2) criErr_Notify2(CRIERR_LEVEL_WARNING, (id ":" msg), (CriUintPtr)(p1), (CriUintPtr)(p2)) + #define criErr_NotifyWarningPrmArray(id, msg, p1, p2, pa) criErr_NotifyPrmArray(CRIERR_LEVEL_WARNING, (id ":" msg), (CriUintPtr)(p1), (CriUintPtr)(p2), (CriUintPtr *)(pa)) + #define criErr_NotifyWarningGeneric(_error_id, _error_no) criErr_NotifyGeneric(CRIERR_LEVEL_WARNING, _error_id, _error_no) +#endif + +/**************************************************************************** + * Data type declaration * + ****************************************************************************/ + +/* Error Callback Function type */ +typedef void (CRIAPI *CriErrCbFunc)(const CriChar8 *errid, CriUint32 p1, CriUint32 p2, CriUint32 *parray); + +/**************************************************************************** + * 変数の宣言 * + * Variable Declaration * + ****************************************************************************/ +/* エラー出力省略用変数 */ +/* default argument of CriError */ +#ifdef __cplusplus +namespace criErr { + extern CriError ErrorContainer; +} +#endif /* __cplusplus */ + +/**************************************************************************** + * 関数の宣言 * + * Function Declaration * + ****************************************************************************/ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +/*JP + * \brief エラーID文字列からエラーメッセージへ変換 + * \ingroup CRI_ERROR + * \param[in] errid エラーID文字列 + * \return エラーメッセージ + * \par 説明: + * エラーID文字列から詳細なエラーメッセージへ変換します。
+ * \attention + * この関数は旧仕様の関数です。
+ * 代わりに ::criErr_ConvertIdToMessage 関数を使用してください。 + * \sa criErr_ConvertIdToMessage + */ +/*EN + * \brief Convert error ID to error message + * \ingroup CRI_ERROR + * \param[in] errid error ID + * \return error message + * \par Explanation: + * This function converts error ID to detailed error message.
+ * \attention + * This function is an obsolete one.
+ * Please use the ::criErr_ConvertIdToMessage function instead. + * \sa criErr_ConvertIdToMessage + */ +const CriChar8* CRIAPI criErr_ConvertIdToMsg(const CriChar8 *errid); + +/*JP + * \brief エラーID文字列からエラーメッセージへ変換 + * \ingroup CRI_ERROR + * \param[in] errid エラーID文字列 + * \param[in] p1 補足情報1 + * \param[in] p2 補足情報2 + * \return エラーメッセージ + * \par 説明: + * エラーID文字列から詳細なエラーメッセージへ変換します。
+ * \par 用例: + * \code + * void user_error_callback_func(const CriChar8 *errid, CriUint32 p1, CriUint32 p2, CriUint32 *parray); + * { + * const CriChar8 *errmsg; + * errmsg = criErr_ConvertIdToMessage(errid, p1, p2); + * printf("%s\n", errmsg); + * } + * \endcode + */ +/*EN + * \brief Convert error ID to error message + * \ingroup CRI_ERROR + * \param[in] errid error ID + * \param[in] p1 supplementary information 1 + * \param[in] p2 supplementary information 2 + * \return error message + * \par Explanation: + * This function converts error ID to detailed error message.
+ * \par Example: + * \code + * void user_error_callback_func(const CriChar8 *errid, CriUint32 p1, CriUint32 p2, CriUint32 *parray); + * { + * const CriChar8 *errmsg; + * errmsg = criErr_ConvertIdToMessage(errid, p1, p2); + * printf("%s\n", errmsg); + * } + * \endcode + */ +const CriChar8* CRIAPI criErr_ConvertIdToMessage(const CriChar8 *errid, CriUint32 p1, CriUint32 p2); + +/*JP + * \brief エラーコールバック関数の登録 + * \ingroup CRI_ERROR + * \param[in] cbf エラーコールバック関数 + * \return なし + * \par 説明: + * エラーコールバック関数を登録します。
+ * 登録された関数は、CRIミドルウエアライブラリ内でエラーが発生したときに呼び出されます。
+ * 同時に登録できるエラーコールバック関数は1つです。
+ * 登録後に再度本関数を呼び出した場合は現在の登録を上書きします。 + * \par 用例: + * \code + * void user_error_callback_func(const CriChar8 *errid, CriUint32 p1, CriUint32 p2, CriUint32 *parray); + * { + * const CriChar8 *errmsg; + * errmsg = criErr_ConvertIdToMessage(errid, p1, p2); + * printf("%s\n", errmsg); + * } + * + * void main(int ac, char *av[]) + * { + * : + * // エラーコールバックの登録 + * criErr_SetCallback(user_error_callback_func); + * : + * } + * \endcode + */ +/*EN + * \brief Register error callback function + * \ingroup CRI_ERROR + * \param[in] cbf error callback function + * \return NONE + * \par Explanation: + * This function registers an error callback function.
+ * The registered function is called if an error occurs within the CRI middleware library. + * \par Example: + * \code + * void user_error_callback_func(const CriChar8 *errid, CriUint32 p1, CriUint32 p2, CriUint32 *parray); + * { + * const CriChar8 *errmsg; + * errmsg = criErr_ConvertIdToMessage(errid, p1, p2); + * printf("%s\n", errmsg); + * } + * + * void main(int ac, char *av[]) + * { + * : + * // Registers the error callback function + * criErr_SetCallback(user_error_callback_func); + * : + * } + * \endcode + */ +void CRIAPI criErr_SetCallback(CriErrCbFunc cbf); + +/*JP + * \brief エラー通知レベルの変更 + * \ingroup CRI_ERROR + * \param[in] level エラー通知レベル + * \return なし + * \par 説明: + * エラーコールバックに通知するエラーのレベルを変更します。 + */ +/*EN + * \brief Change error notification level + * \ingroup CRI_ERROR + * \param[in] level error notification level + * \return NONE + * \par Explanation: + * This function changes the level of error information that is notified to the error callback. + */ +void CRIAPI criErr_SetErrorNotificationLevel(CriErrorNotificationLevel level); + +/*JP + * \brief エラー発生回数の取得 + * \ingroup CRI_ERROR + * \param[in] level エラーレベル + * \return エラー発生回数 + * \par 説明: + * エラー発生回数を取得します。 + */ +/*EN + * \brief Retrieve error count + * \ingroup CRI_ERROR + * \param[in] level error level + * \return number of errors occured + * \par Explanation: + * This function retrieves the number of errors occured. + */ +CriUint32 CRIAPI criErr_GetErrorCount(CriErrorLevel level); + +/*JP + * \brief エラー発生回数のリセット + * \ingroup CRI_ERROR + * \param[in] level エラーレベル + * \return なし + * \par 説明: + * エラー発生回数のカウンタを0に戻します。 + */ +/*EN + * \brief Resets error count + * \ingroup CRI_ERROR + * \param[in] level error level + * \return NONE + * \par Explanation: + * This function resets the counter for number of errors occured. + */ +void CRIAPI criErr_ResetErrorCount(CriErrorLevel level); + +/* エラーコールバックを発生させる (内部関数) */ +/* Error notification (Internal functions) */ +void CRIAPI criErr_Notify(CriErrorLevel level, const CriChar8 *errid); +void CRIAPI criErr_Notify1(CriErrorLevel level, const CriChar8 *errid, CriUintPtr p1); +void CRIAPI criErr_Notify2(CriErrorLevel level, const CriChar8 *errid, CriUintPtr p1, CriUintPtr p2); +void CRIAPI criErr_NotifyPrmArray(CriErrorLevel level, const CriChar8 *errid, CriUintPtr p1, CriUintPtr p2, CriUintPtr *pa); +void CRIAPI criErr_NotifyGeneric(CriErrorLevel level, const CriChar8 *error_id, CriError error_no); +void CRIAPI criErr_NotifyErrorSimple(void); +void CRIAPI criErr_NotifyWarningSimple(void); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +/*************************************************************************** + * 旧バージョンとの互換用 + * For compatibility with old versions + ***************************************************************************/ +#define criErr_Invoke(errid) criErr_Notify(CRIERR_LEVEL_ERROR, errid) +#define criErr_Invoke1(errid, p1) criErr_Notify1(CRIERR_LEVEL_ERROR, errid, p1) +#define criErr_Invoke2(errid, p1, p2) criErr_Notify2(CRIERR_LEVEL_ERROR, errid, p1, p2) +#define criErr_InvokePrmArray(errid, p1, p2, pa) criErr_NotifyPrmArray(CRIERR_LEVEL_ERROR, errid, p1, p2, pa) +#define criErr_InvokeGeneric(error_id, error_no) criErr_NotifyGeneric(CRIERR_LEVEL_ERROR, error_id, error_no) +#define criErr_Occur(id, msg) criErr_Notify(CRIERR_LEVEL_ERROR, id ":" msg) +#define criErr_Occur1(id, msg, p1) criErr_Notify1(CRIERR_LEVEL_ERROR, (id ":" msg), (CriUintPtr)(p1)) +#define criErr_Occur2(id, msg, p1, p2) criErr_Notify2(CRIERR_LEVEL_ERROR, (id ":" msg), (CriUintPtr)(p1), (CriUintPtr)(p2)) +#define criErr_OccurPrmArray(id, msg, p1, p2, pa) criErr_NotifyPrmArray(CRIERR_LEVEL_ERROR, (id ":" msg), (CriUintPtr)(p1), (CriUintPtr)(p2), (CriUintPtr*)(pa)) +#define criErr_OccurGeneric(_error_id, _error_no) criErr_NotifyGeneric(CRIERR_LEVEL_ERROR, _error_id, _error_no) + +/*EN + * @} + */ +/*JP + * @} + */ + +#endif // _CRI_ERROR_H_INCLUDED + +/* --- end of file --- */ diff --git a/3rdParty/cri/Durango/include/cri_heap.h b/3rdParty/cri/Durango/include/cri_heap.h new file mode 100644 index 00000000..49e85012 --- /dev/null +++ b/3rdParty/cri/Durango/include/cri_heap.h @@ -0,0 +1,640 @@ +#ifndef _CRI_HEAP_H_INCLUDED +#define _CRI_HEAP_H_INCLUDED +/**************************************************************************** + * * + * CRI Heap Manager "CriHeap" Library * + * * + * 2005-03-17 written by satouo * + * * + ****************************************************************************/ +/*! + * \file cri_heap.h + */ + +/**************************************************************************** + * インクルードファイル * + * Include file * + ****************************************************************************/ +#include "cri_xpt.h" + +#ifdef XPT_TGT_PC +#pragma pack(push) +#pragma pack(1) //The boundary value of structure is adjusted to 1 byte. +#endif + +/**************************************************************************** + * 定数マクロ * + * MACRO CONSTANT * + ****************************************************************************/ +/* Version number of CRIHEAP */ +#define CRIHEAP_NAME_STRINGS "CRI Heap" +#define CRIHEAP_VERSION_STRINGS "1.21.02" + +/* Default memory alignment */ +#define CRIHEAP_DEFAULT_MEM_ALIGN (8) + +/**************************************************************************** + * 列挙定数マクロ * + * ENUM CONSTANT * + ****************************************************************************/ +/*JP + * \brief メモリのタイプ + */ +/*EN + * \brief Types of heap + */ +typedef enum { + CRIHEAP_TYPE_FIX = (1), + CRIHEAP_TYPE_TEMPORARY = (2), + CRIHEAP_TYPE_DYNAMIC = (3), // unuse + CRIHEAP_TYPE_NONE = (0), + /* enum be 4bytes */ + CRIHEAP_TYPE_ENUM_BE_SINT32 = 0x7FFFFFFF +} CriHeapType; + +/**************************************************************************** + * データ型 * + * Data type declaration * + ****************************************************************************/ +/* CriHeapハンドル */ +/* CriHeap handle */ +#ifndef CRIHEAP_DEFINED +#define CRIHEAP_DEFINED + +/* internal */ +typedef struct CriHeapBlockTag { + struct CriHeapBlockTag *prevblock; + struct CriHeapBlockTag *nextblock; + CriSint32 memsize; + CriUint8 used; + CriUint8 type; + CriUint16 alignspc; + CriUint16 gap; + CriChar8 *nameadr; +} CriHeapBlock, *CriHeapBlockPtr; + +/*JP + * \brief CRI Heapハンドル + * \struct CriHeap + * \ingroup CRIHEAP_BASIC + * CRI Heapを用いてメモリアロケートを行うために必要なハンドルです。
+ * このハンドルに対して、メモリアロケートやメモリフリーを行います。 + * \sa criHeap_Create(), criHeap_Destroy() + */ +/*EN + * \brief CRI Heap handle + * \struct CriHeap + * \ingroup CRIHEAP_BASIC + * \par Description: + * The heap handle. This data structure needs to exist through the life cycle of + * the heap. It allows the library to allocate and deallocate memory + * internally within the heap. Typically this handle gets allocated at the + * beginning of the heap memory that you've provided for the heap, but don't + * depend on this behavior. The heap itself is opaque. You can of course + * allocate multiple non-contiguous heaps, but these will be separate heap + * structures and a single allocation won't choose between them. + * + * \sa criHeap_Create(), criHeap_Destroy() + */ +typedef struct _criheap_struct { + struct _criheap_vfunctiontable *vtbl; + CriSint32 totalsize; + CriSint32 peaksize; + CriSint32 currentsize; + CriHeapBlock *topblock; + CriHeapBlock *taleblock; +} CriHeapObj, *CriHeap; + +/*JP + * \brief CRI Heap仮想関数テーブル + * \struct criHeapVirtualFunctionTable + * \ingroup CRIHEAP_BASIC + * 独自のメモリアロケート関数を実装する際に使用する仮想関数テーブル構造体です。
+ * 各関数はマルチスレッドセーフである必要があります。
+ * \par 備考: + * 3番目のアロケート関数は現在未使用です。 + */ +/*EN + * \brief CRI Heap Virtual Function Table + * \struct criHeapVirtualFunctionTable + * \ingroup CRIHEAP_BASIC + * \par Description: + * The virtual functions table for original allocation functions.
+ * The third allocation function is not in use currently. + */ +typedef struct _criheap_vfunctiontable { + /*JP + * \brief メモリのアロケート(メモリ領域の先端から) + * \par 説明: + * criHeap_AllocFix関数呼び出し時に呼ばれます。 + * \sa criHeap_AllocFix() + */ + /*EN + * \brief Memory allocation (allocating from the top of the memory area) + * \par Description: + * Called from criHeap_AllocFix(). + * \sa criHeap_AllocFix() + */ + void *(*AllocFix)(CriHeap heap, CriSint32 size, const CriChar8 *name, CriSint32 align); + /*JP + * \brief メモリのアロケート(メモリ領域の終端から) + * \par 説明: + * criHeap_AllocFix関数呼び出し時に呼ばれます。 + * \sa criHeap_AllocTemporary() + */ + /*EN + * \brief Memory allocation (allocating from the tail of the memory area) + * \par Description: + * Called from criHeap_AllocTemporary(). + * \sa criHeap_AllocTemporary() + */ + void *(*AllocTemporary)(CriHeap heap, CriSint32 size, const CriChar8 *name, CriSint32 align); + /*JP + * \brief 未使用関数 + */ + /*EN + * \brief Unused + */ + void *(*AllocDynamic)(CriHeap heap, CriSint32 size, const CriChar8 *name, CriSint32 align); // unused + + /*JP + * \brief メモリのフリー + * \par 説明: + * criHeap_Free関数呼び出し時に呼ばれます。 + * \sa criHeap_Free() + */ + /*EN + * \brief Memory deallocation + * \par Description: + * Called from criHeap_Free(). + * \sa criHeap_Free() + */ + CriSint32 (*Free)(CriHeap heap, void *ptr); +} criHeapVirtualFunctionTable; + +#endif + + +/**************************************************************************** + * 関数の宣言 + * Function Declaration + ****************************************************************************/ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +/*==========================================================================* + * ライブラリの初期化と終了処理 + * Initialize and Finalize of Library + *==========================================================================*/ +/*JP + * \brief CRI Heapライブラリの初期化 + * \ingroup CRIHEAP_BASIC + * \par 説明: + * CRI Heapライブラリを使用するために必要な初期化関数です。
+ * CRI Heapを使用する際はあらかじめ本関数をコールする必要があります。 + * \sa criHeap_Finalize() + */ +/*EN + * \brief Initialize the heap manager. + * \ingroup CRIHEAP_BASIC + * \par Description: + * This function initializes the heap manager and prepares it to manage heaps. + * This function only has an effect the first time it is called in your program. + * Subsequent calls only increment an internal counter. This allows your + * program to call criHeap_Initialize() in pairs with criHeap_Finalize() + * throughout your program modules, and only the initial call to criHeap_Initialize() + * and the final call to criHeap_Finalize() will have any effect. + * \if ps2 + * \par PS2 only: + * This function does a sanity check to make sure that the size of the CriHeapObj + * data structure is a factor of 16. If it is not a factor of 16, this function + * hangs. + * \endif + * \sa criHeap_Finalize() + */ +void CRIAPI criHeap_Initialize(void); + +/*JP + * \brief CRI Heapライブラリの終了 + * \ingroup CRIHEAP_BASIC + * \par 説明: + * CRI Heapライブラリを終了するために必要な終了関数です。
+ * CRI Heapの使用を終了する際は本関数をコールしてください。 + * \sa criHeap_Initialize() + */ +/*EN + * \brief Finalize the heap manager. + * \ingroup CRIHEAP_BASIC + * \par Description: + * This function finalizes the heap manager. If the criHeap_Initialize() function + * is called n times, then the nth time that criHeap_Finalize() + * is called, this function invalidates any heaps currently in use. Calling + * any heap function after the nth call to criHeap_Finalize() will + * have unpredictable results. + * \sa criHeap_Initialize() + */ +void CRIAPI criHeap_Finalize(void); + +/*==========================================================================* + * ハンドルの生成・解放 + *==========================================================================*/ +/*JP + * \brief CRI Heapハンドルの生成 + * \ingroup CRIHEAP_BASIC + * \param ptr メモリ領域のポインタ。 + * \param size メモリ領域のサイズ。 + * \return CRI Heapハンドル。
生成に失敗した場合は、NULLが返ります。 + * \par 説明: + * CRI Heapハンドルを生成します。
+ * 本関数で与えるメモリ領域は、CRI Heap自身のハンドル領域やアロケート時に + * 確保されるメモリ領域となります。
+ * 管理領域を含むため、メモリ領域すべてがアロケート出来ない点に注意してください。 + * 管理領域の目安は「1ハンドルあたりsizeof(CriHeapObj)」+「1アロケートあたり + * sizeof(CriHeapBlock)+各メモリアライメントに必要なサイズ」となります。 + * \code + * CriChar8 heap_buffer[0x2000]; + * CriHeap heap = criHeap_Create((void *)heap_buffer, sizeof(heap_buffer); + * \endcode + * \sa criHeap_Destroy() + */ +/*EN + * \brief Create a contiguous heap in memory. + * \ingroup CRIHEAP_BASIC + * \param ptr A pointer to the start of the memory region to use as a heap. + * \param size The size of the region to be used as a heap. + * \return A valid CriHeap handle if successful, or NULL if unsuccessful. + * \par Description: + * This function allows you to set aside a region of memory for this library's + * use as a "heap". Heap allocation is required before active playback + * can begin. + * This function will fail and return NULL if the size of the memory region + * is smaller than the CriHeapObj structure. + * \code + * CriChar8 heap_buffer[0x2000]; + * CriHeap heap = criHeap_Create((void *)heap_buffer, sizeof(heap_buffer); + * \endcode + * \sa criHeap_Destroy() + */ +CriHeap CRIAPI criHeap_Create(void *ptr, CriSint32 size); + +/*JP + * \brief 非スレッドセーフなCRI Heapハンドルの生成 + * \ingroup CRIHEAP_BASIC + * \param ptr メモリ領域のポインタ。 + * \param size メモリ領域のサイズ。 + * \return CRI Heapハンドル。
生成に失敗した場合は、NULLが返ります。 + * \par 説明: + * CRI Heapハンドルを生成します。
+ * 本関数を使用して作成されたヒープは、排他制御が行なわれません。
+ * 複数スレッドから同時に参照されるヒープの作成には、criHeap_Create関数をご利用ください。 + * \sa criHeap_Create(), criHeap_Destroy() + */ +/*EN + * \brief Create a contiguous heap in memory. + * \ingroup CRIHEAP_BASIC + * \param ptr A pointer to the start of the memory region to use as a heap. + * \param size The size of the region to be used as a heap. + * \return A valid CriHeap handle if successful, or NULL if unsuccessful. + * \par Description: + * This function creates a heap to use the static memory as dynamically allocatable memory. + * The heap created by using this function is not threadsafe. + * If heap will be accessed by multiple threads, you must create the heap by using the criHeap_Create function. + * \sa criHeap_Create(), criHeap_Destroy() + */ +CriHeap CRIAPI criHeap_CreateNoSerialize(void *ptr, CriSint32 size); + +/*JP + * \brief CRI Heapハンドルの解放 + * \ingroup CRIHEAP_BASIC + * \param heap CRI Heapハンドル。 + * \par 説明: + * CRI Heapハンドルを解放します。
criHeap_Create() で指定されたメモリ領域が + * 解放され、CRI Heapハンドルは無効となります。 + * \sa criHeap_Create() + */ +/*EN + * \brief Destroy a previously created heap. + * \ingroup CRIHEAP_BASIC + * \param heap A CriHeap handle previously created with criHeap_Create(). + * \par Description: + * This function frees all internal allocations previously performed on + * the heap and frees the memory. Internally, this function does in + * fact walk through the heap, finding and freeing all allocations, e.g. + * it is not stubbed. So calling this function on a trashed heap + * will have unpredictable results. + * \sa criHeap_Create() + */ +void CRIAPI criHeap_Destroy(CriHeap heap); + +/*==========================================================================* + * Allocation + *==========================================================================*/ +/*JP + * \brief メモリのアロケート(メモリ領域の先端から) + * \ingroup CRIHEAP_ALLOC + * \param heap CRI Heapハンドル。 + * \param size アロケートするメモリのサイズ。 + * \param name アロケートするメモリの名前。名前はデバッグ時に使用されます。 + * \param align アロケートするメモリのアライメント。 + * \return アロケートしたメモリへのポインタ。
アロケートに失敗した場合はNULLが返ります。 + * \par 説明: + * メモリ領域の先端側から確保するメモリアロケーション関数です。ヒープ領域内に\ref block_fix "Fixブロック"を作成します。
+ * メモリの断片化を防ぐため、同じサイズ/アライメントの解放済み\ref block_fix "Fixブロック"を先端側から探して、再利用するように試みます。それが見つからない場合は、未使用の空き領域(\ref block_free "Freeブロック")を分割してメモリを取得します。 + * \code + * CriChar8 heap_buffer[0x2000]; + * CriHeap heap = criHeap_Create((void *)heap_buffer, sizeof(heap_buffer); + * void *memptr = criHeap_AllocFix(heap, 0x100, "forTexture1", 64); + * \endcode + * \sa criHeap_AllocTemporary(), criHeap_Free() + */ +/*EN + * \brief Memory allocation (allocating from the top of the memory area) + * \ingroup CRIHEAP_ALLOC + * \param heap CRI Heap handle + * \param size Memory block size to be allocated + * \param name Memory block name, which is used on debugging + * \param align Memory block alignment + * \return A pointer to the allocated memory block.
Returns NULL if unsuccessful. + * \par Description: + * This function allocates a memory block from the top of the memory area and creates a \ref block_fix "Fix block" in the heap area.
+ * To prevent memory fragmentation, a released \ref block_fix "Fix block" with the same size and alignment is searched for in the heap area from the top to the bottom and tries to reused the block. And if not found, an unused free block (\ref block_free "Free block") is divided and a new block is allocated. + * \code + * CriChar8 heap_buffer[0x2000]; + * CriHeap heap = criHeap_Create((void *)heap_buffer, sizeof(heap_buffer); + * void *memptr = criHeap_AllocFix(heap, 0x100, "forTexture1", 64); + * \endcode + * \sa criHeap_AllocTemporary(), criHeap_Free() + */ +void * CRIAPI criHeap_AllocFix(CriHeap heap, CriSint32 size, const CriChar8 *name, CriSint32 align); + +/*JP + * \brief メモリのアロケート(メモリ領域の終端から) + * \ingroup CRIHEAP_ALLOC + * \param heap CRI Heapハンドル。 + * \param size アロケートするメモリのサイズ。 + * \param name アロケートするメモリの名前。名前はデバッグ時に使用されます。 + * \param align アロケートするメモリのアライメント。 + * \return アロケートしたメモリへのポインタ。
アロケートに失敗した場合はNULLが返ります。 + * \par 説明: + * メモリ領域の終端側から確保するメモリアロケーション関数です。ヒープ領域内に\ref block_temporary "Temporaryブロック"を作成します。
+ * 要求したサイズ/アライメントをアロケート可能な解放済み\ref block_temporary "Temporaryブロック"を終端側から探して、分割または再利用するように試みます。それが見つからない場合は、未使用の空き領域(\ref block_free "Freeブロック")を分割してメモリを取得します。
+ * ヒープ領域の終端側からメモリをアロケートするため、先端側での断片化を防ぐことが出来ます。
+ * 主に、一時的に利用するメモリに使用します。 + * \sa criHeap_AllocFix(), criHeap_Free() + */ +/*EN + * \brief Memory allocation (allocating from the tail of the memory area) + * \ingroup CRIHEAP_ALLOC + * \param heap CRI Heap handle + * \param size Memory block size to be allocated + * \param name Memory block name, which is used on debugging + * \param align Memory block alignment + * \return A pointer to the allocated memory block.
Returns NULL if unsuccessful. + * \par Description: + * This function allocates a memory block from the bottom of the memory area and creates a \ref block_temporary "Temporary block" in the heap area.
+ * A released \ref block_temporary "Temporary block" available with the requested size and alignment is searched for in the heap area from the bottom and tries to divide and to reuse the block. And if not found, an unused free block (\ref block_free "Free block") is divided and a new block is allocated.
+ * Allocating from the bottom of the heap area will prevent fragmentation in the top of the heap area.
+ * Temporary block is mainly used for the memory area that is temporarily used. + * \sa criHeap_AllocFix(), criHeap_Free() + */ +void * CRIAPI criHeap_AllocTemporary(CriHeap heap, CriSint32 size, const CriChar8 *name, CriSint32 align); + +/* DYNAMIC (unuse) */ +//void * CRIAPI criHeap_AllocDynamic(CriHeap heap, CriSint32 size, const CriChar8 *name, CriSint32 align); + +void * CRIAPI criHeap_Alloc(CriHeap heap, CriSint32 size, const CriChar8 *name, CriSint32 align, CriSint32 type); + +/*==========================================================================* + * Free + *==========================================================================*/ +/*JP + * \brief メモリのフリー + * \ingroup CRIHEAP_ALLOC + * \param heap CRI Heapハンドル。 + * \param ptr アロケートしたメモリのポインタ。 + * \return フリーされたメモリサイズ。 + * \par 説明: + * アロケートされたメモリをフリーします。
+ * \code + * void *memptr = criHeap_AllocFix(heap, 0x100, "forTexture1", 64); + * criHeap_Free(heap, memptr); + * \endcode + * \sa criHeap_AllocFix(), criHeap_AllocTemporary() + */ +/*EN + * \brief Memory deallocation + * \ingroup CRIHEAP_ALLOC + * \param heap CRI Heap handle + * \param ptr The pointer to the allocated memory block + * \return Deallocated memory block size + * \par Description: + * This function deallocates the allocated memory block.
+ * \code + * void *memptr = criHeap_AllocFix(heap, 0x100, "forTexture1", 64); + * criHeap_Free(heap, memptr); + * \endcode + * \sa criHeap_AllocFix(), criHeap_AllocTemporary() + */ +CriSint32 CRIAPI criHeap_Free(CriHeap heap, void *ptr); + +/*==========================================================================* + * 排他制御用関数 + *==========================================================================*/ +CriSint32 CRIAPI criHeap_EnterCriticalSection(void); +CriSint32 CRIAPI criHeap_LeaveCriticalSection(void); + +/*==========================================================================* + * その他の関数 + *==========================================================================*/ +/* For only internal use */ +CriSint32 CRIAPI criHeap_SwitchAllocFunctions(CriHeap heap); + +/*==========================================================================* + * デバッグ関連 + *==========================================================================*/ +/*JP + * \brief ピークメモリサイズの取得 + * \ingroup CRIHEAP_DEBUG + * \param heap CRI Heapハンドル。 + * \return 使用されたメモリの最大値。 + * \par 説明: + * 過去、使用されたメモリ量の最大値を返します。
+ * 最大値はcriHeap_DebugResetPeakMemorySize() でリセットすることが出来ます。 + * \sa criHeap_DebugResetPeakMemorySize() + */ +/*EN + * \brief Returns peak memory usage of the heap. + * \ingroup CRIHEAP_DEBUG + * \param heap The heap previously allocated by criHeap_Create(). + * \return The maximum number of bytes used by the heap. + * \par Description: + * The amount of memory used by these libraries is variable and depends + * on the number of simultaneous streams being read, the seek and error + * frequency within the stream being read, video resolution and other + * factors. This function allows you to tune the allocation of the heap + * to achieve a required performance level while allocating minimal + * heap space for this library. To get accurate readings, this function + * should typically be called just before criHeap_Destroy(), and after + * exercising all the video and audio functions in your program. + */ +CriSint32 CRIAPI criHeap_DebugGetPeakMemorySize(CriHeap heap); + +/*JP + * \brief ピークメモリサイズのリセット + * \ingroup CRIHEAP_DEBUG + * \param heap CRI Heapハンドル。 + * \par 説明: + * ピークメモリサイズをリセットします。 + * \sa criHeap_DebugGetPeakMemorySize() + */ +/*EN + * \brief Reset peak memory size + * \ingroup CRIHEAP_DEBUG + * \param heap CRI Heap handle + * \par Description: + * The peak memory size is reset. + * \sa criHeap_DebugGetPeakMemorySize() + */ +void CRIAPI criHeap_DebugResetPeakMemorySize(CriHeap heap); + +/*JP + * \brief メモリブロック数の取得 + * \ingroup CRIHEAP_DEBUG + * \param heap CRI Heapハンドル。 + * \return メモリブロック数。 + * \par 説明: + * アロケートされたメモリのブロック数を返します。
+ * CRI Heapハンドル生成直後は未使用のメモリブロックが1つ存在する状態 + * となります。また、フリーされた断片化されたメモリブロックもこの数に + * 含みます。 + * \sa criHeap_DebugGetUsedBlocks() + */ +/*EN + * \brief Get number of allocated memory blocks + * \ingroup CRIHEAP_DEBUG + * \param heap CRI Heap handle + * \return Number of allocated memory blocks + * \par Description: + * The number of allocated memory blocks is returned.
+ * One unused memory block exists right after CRI Heap handle creation. + * The number of released fragmented memory blocks is also included. + * \sa criHeap_DebugGetUsedBlocks() + */ + CriSint32 CRIAPI criHeap_DebugGetNumBlocks(CriHeap heap); + +/*JP + * \brief 使用メモリブロック数の取得 + * \ingroup CRIHEAP_DEBUG + * \param heap CRI Heapハンドル。 + * \return 使用メモリブロック数。 + * \par 説明: + * アロケートされているメモリブロックの数を返します。 + * \sa criHeap_DebugGetNumBlocks() + */ +/*EN + * \brief Get number of used memory blocks + * \ingroup CRIHEAP_DEBUG + * \param heap CRI Heap + * \return Number of used memory blocks + * \par Description: + * The number of used memory blocks is returned.
+ * \sa criHeap_DebugGetNumBlocks() + */ +CriSint32 CRIAPI criHeap_DebugGetUsedBlocks(CriHeap heap); + +/*JP + * \brief メモリブロック名の取得 + * \ingroup CRIHEAP_DEBUG + * \param heap CRI Heapハンドル。 + * \param ptr アロケートしたメモリのポインタ。 + * \return メモリブロック名。 + * \par 説明: + * アロケート時に設定したメモリブロック名へのポインタを返します。
+ */ +/*EN + * \brief Get memory block name + * \ingroup CRIHEAP_DEBUG + * \param heap CRI Heap + * \param ptr A pointer to the allocated memory block + * \return Memory block name + * \par Description: + * The pointer to the memory block name specified on allocation is returned.
+ */ +CriChar8 * CRIAPI criHeap_DebugGetBlockName(CriHeap heap, void *ptr); + +/* メモリブロック番号の取得 */ +//CriSint32 CRIAPI criHeap_DebugGetBlockNumberFromPointer(CriHeap heap, void *ptr); + +/* メモリブロック情報の取得 */ +//void CRIAPI criHeap_DebugGetBlockInformation(CriHeap heap, +// CriSint32 blocknumber, CriHeapBlock *heapblock); + +/* メモリブロック情報の表示 */ +//void CRIAPI criHeap_DebugPrintBlockInformation(CriHeap heap, +// CriSint32 blocknumber, CriHeapBlock *heapblock); + +/*JP + * \brief メモリブロック情報の表示 + * \ingroup CRIHEAP_DEBUG + * \param heap CRI Heapハンドル。 + * \par 説明: + * 現在のメモリブロック情報を表示します。
+ * printf関数などの標準出力に表示を行います。 + */ +/*EN + * \brief Print memory block information + * \ingroup CRIHEAP_DEBUG + * \param heap CRI Heap + * \par Description: + * The current memory block information is displayed.
+ * It is displayed on the standard output for the printf function. + */ + void CRIAPI criHeap_DebugPrintBlockInformationAll(CriHeap heap); + +/*JP + * \brief メモリアロケートサイズの取得 + * \ingroup CRIHEAP_DEBUG + * \param heap CRI Heapハンドル。 + * \par 説明: + * 現在のメモリアロケートサイズの合計値を返します。 + */ +/*EN + * \brief Get total allocation size + * \ingroup CRIHEAP_DEBUG + * \param heap CRI Heap + * \par Description: + * The total size of allocated memory blocks is returned. + */ +CriSint32 CRIAPI criHeap_DebugGetTotalAllocSize(CriHeap heap); + +/* フリーサイズの取得 */ +//CriSint32 CRIAPI criHeap_DebugGetTotalFreeSize(CriHeap heap); + +/* メモリアロケートサイズの取得(タイプ別) */ +CriSint32 CRIAPI criHeap_DebugGetAllocSize(CriHeap heap, CriSint32 type); + +/* ヒープヘッダサイズの取得 */ +CriSint64 CRIAPI criHeap_DebugGetHandleHeaderSize(CriHeap heap); + +/* メモリブロックヘッダサイズの取得 ptr: Allocated Pointer */ +CriSint64 CRIAPI criHeap_DebugGetMemBlockHeaderSize(void *ptr); + +/* 追加で必要となるサイズの最大値 */ +CriSint32 CRIAPI criHeap_DebugGetWorstExtraSize(CriSint32 alignment); + +/* criHeap_AllocFixでアロケート可能なサイズ */ +CriSint32 CRIAPI criHeap_DebugGetFixAllocatableSize(CriHeap heap, CriSint32 alignment); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#ifdef XPT_TGT_PC +#pragma pack(pop) +#endif + +#endif // _CRI_HEAP_H_INCLUDED + +/* end of file */ diff --git a/3rdParty/cri/Durango/include/cri_movie_core.h b/3rdParty/cri/Durango/include/cri_movie_core.h new file mode 100644 index 00000000..d695a4df --- /dev/null +++ b/3rdParty/cri/Durango/include/cri_movie_core.h @@ -0,0 +1,2572 @@ +/**************************************************************************** + * + * CRI Middleware SDK + * + * Copyright (c) 2005-2013 CRI Middleware Co., Ltd. + * + * Library : CRI Movie + * Module : Library User's Header + * File : cri_movie_core.h + * Date : 2013-09-27 + * Version : (see CRIMVPLY_VER) + * + ****************************************************************************/ +/*! + * \file cri_movie_core.h + */ +#ifndef CRI_MOVIE_CORE_H_INCLUDED /* Re-definition prevention */ +#define CRI_MOVIE_CORE_H_INCLUDED + +/* Version No. */ +#define CRIMVPLY_VER "3.40" +#define CRIMVPLY_NAME "criMvPly" + +/*************************************************************************** + * Include file + ***************************************************************************/ +#include +#include +#include + +/*************************************************************************** + * MACRO CONSTANT + ***************************************************************************/ + +/*EN + * \brief Audio OFF setting of Audio Track + * \ingroup MDL_MV_OPTION + * \sa CriMvEasyPlayer::SetAudioTrack() + */ +/*JP + * \brief オーディオ再生OFFの指定値 + * \ingroup MDL_MV_OPTION + * \sa CriMvEasyPlayer::SetAudioTrack() + */ +#define CRIMV_AUDIO_TRACK_OFF (-1) + +/*EN + * \brief Default setting of Audio Track + * \ingroup MDL_MV_OPTION + * \sa CriMvEasyPlayer::SetAudioTrack() + */ +/*JP + * \brief オーディオチャネルのデフォルト値 + * \ingroup MDL_MV_OPTION + * \sa CriMvEasyPlayer::SetAudioTrack() + */ +#define CRIMV_AUDIO_TRACK_AUTO (100) + +/*EN + * \brief Maximum number of PCM tracks in one audio stream + * \ingroup MDL_MV_OPTION + */ +/*JP + * \brief オーディオデータ内の最大PCMトラック数 + * \ingroup MDL_MV_OPTION + */ +#define CRIMV_PCM_BUFFER_MAX (8) + +/*EN + * \brief Subtitle OFF setting + * \ingroup MDL_MV_OPTION + * \sa CriMvEasyPlayer::SetSubtitleChannel() + */ +/*JP + * \brief 字幕再生OFFの指定値 + * \ingroup MDL_MV_OPTION + * \sa CriMvEasyPlayer::SetSubtitleChannel() + */ +#define CRIMV_SUBTITLE_CHANNEL_OFF (-1) + +/*EN + * \brief Maximum number of video tracks in a movie file + * \ingroup MDL_MV_OPTION + */ +/*JP + * \brief ムービファイル内の最大ビデオストリーム数 + * \ingroup MDL_MV_OPTION + */ +#define CRIMV_MAX_VIDEO_NUM (1) + +/*EN + * \brief Maximum number of audio tracks in a movie file + * \ingroup MDL_MV_OPTION + */ +/*JP + * \brief ムービファイル内の最大オーディオストリーム数 + * \ingroup MDL_MV_OPTION + */ +#define CRIMV_MAX_AUDIO_NUM (32) + +/*EN + * \brief Maximum number of alpha tracks in a movie file + * \ingroup MDL_MV_OPTION + */ +/*JP + * \brief ムービファイル内の最大アルファストリーム数 + * \ingroup MDL_MV_OPTION + */ +#define CRIMV_MAX_ALPHA_NUM (1) + +#if defined(XPT_TGT_PC) +/*EN + * \brief Number of extra threads for multicore decoding + * \ingroup MDL_MV_OPTION + * The number of additional decoding threads that CRI Movie library internally creates. + * The threads are intended to run on multiple processors in parallel. + * \sa CriMvEasyPlayer::SetUsableProcessors_PC() + */ +/*JP + * \brief マルチコアデコード用の追加のデコードスレッド数 + * \ingroup MDL_MV_OPTION + * CRI Movieライブラリが内部で作成する追加のデコードの数です。これらのスレッドは、マルチコアPC上で + * デコード処理を並列分散させるために作られます。 + * \sa CriMvEasyPlayer::SetUsableProcessors_PC() + */ +#define CRIMV_NUM_EXT_DECTHREAD_PC (3) + +/*EN + * \brief Default affnity mask of a thread + * \ingroup MDL_MV_OPTION + * \sa CriMvEasyPlayer::SetUsableProcessors_PC() + */ +/*JP + * \brief スレッドアフィニティマスクのデフォルト設定値 + * \ingroup MDL_MV_OPTION + * \sa CriMvEasyPlayer::SetUsableProcessors_PC() + */ +#define CRIMV_DEFAULT_AFFNITY_MASK_PC (0xFFFFFFFF) + + +/*EN + * \brief Default priority of a thread + * \ingroup MDL_MV_OPTION + * \sa CriMvEasyPlayer::SetUsableProcessors_PC() + */ +/*JP + * \brief スレッドのデフォルト優先度 + * \ingroup MDL_MV_OPTION + * \sa CriMvEasyPlayer::SetUsableProcessors_PC() + */ +#define CRIMV_DEFAULT_THREAD_PRIORITY_PC (0x8000000) +#endif + +/*EN + * \brief Default value of the read buffer size + * \ingroup MDL_MV_OPTION + * \sa CriMvEasyPlayer::SetReadBufferSize() + */ +/*JP + * \brief リードバッファサイズをデフォルト値 + * \ingroup MDL_MV_OPTION + * \sa CriMvEasyPlayer::SetReadBufferSize() + */ +#define CRIMV_READ_BUFFER_SIZE_AUTO (-1) + + +/*************************************************************************** + * Library Spec Defenition + ***************************************************************************/ + +/* */ + +/* 2007-09-06:URUSHI オーディオ処理のサブモジュール化 * + * MvPlyのオーディオ処理部分をCriMvPlyAmngという新たなクラスに切り出す。* + * CriMvPlyAmngはデマルチプレクサから全トラックデータを受け取って、 * + * トラックごとに割り振られたAdecに処理を渡します。 * + * 目的は以下の二つ * + * 1) オーディオトラックの動的切替 * + * 2) ループ再生での異なるAV尺の同期 */ + +#define NUM_MAX_ADEC (2) /* Adecの最大数 */ +/* ADECのインデックス定義 */ +/* このindexを使ってCriMvPlyAmngからAdecをコントロールしてください。 */ +#define MAIN_ADEC_IDX (0) // メイントラック用 +#define SUB_ADEC_IDX (1) // ボイストラック用 + +/* オーディオの動的切替機能をサポートするか */ +//#define ENABLE_DYNAMIC_AUDIO_SWITCH + +#if defined(ENABLE_DYNAMIC_AUDIO_SWITCH) + #define CRIMVPLYAMNG_TRACK_OFF (512) // 切り替え先トラック番号のデフォルト値(切替OFF) + + /* トラックの動的切替のための状態定義 */ + typedef enum _crimvplyamng_track_state { + CRIMVPLYAMNG_TRACK_STATE_FIXED = (1), // デフォルト + CRIMVPLYAMNG_TRACK_STATE_PREP_SWITCHING, // ユーザが切替を命令し、切替の準備段階(時刻判定のための基準時間をセット) + CRIMVPLYAMNG_TRACK_STATE_SWITCHING // 切替元と先の時刻判定を行なって切替を行なう状態 + } CriMvPlyAmngTrackState; +#endif + +/* 連結再生時、2個目以降のヘッダを取得できるようにするため */ +#define CRIMVPLY_HEAD_CONTAINER_NUM (2) + +/* 再読み込み閾値のデフォルト値 */ +#define CRIMV_DEFAULT_RELOAD_THRESHOLD (0.8f) // 0.8[sec] + +/* 再生準備中の貯金フレーム数デフォルト値 */ +#define CRIMV_DEFAULT_NUM_FRAMES_FOR_PREP (-1) /* デフォルト:不使用 (フレームプール数を採用) */ + +/* CriMvPly内部でキープするデリゲートスレッド設定用の配列数 */ +#if defined(XPT_TGT_PC) + #define CRIMV_DLGTHREAD_NUM (64) +#elif defined(XPT_TGT_XBOX360) + #define CRIMV_DLGTHREAD_NUM (6 - 1) // 6 HW thread - ユーザアイドルスレッド +#elif defined(XPT_TGT_VITA) + #define CRIMV_DLGTHREAD_NUM (2) +#elif defined(XPT_TGT_WIIU) + #define CRIMV_DLGTHREAD_NUM (2) +#endif + +/* 内部ワーク領域の確保にCRI Heapを使用しない */ +#define CRIMV_REMOVE_CRIHEAP + +/* 機種固有フレーム情報数 */ +#define CRIMV_FRAME_DETAILS_NUM (2) + +/* CriVavfios で指定する外部ファイルのパスの上限 */ +#if defined(XPT_TGT_IOS) + #define CRIMVPLY_VAVFIOS_MAX_FILEPATH (256) +#endif + +/*************************************************************************** + * Process MACRO + ***************************************************************************/ +#define criMv_SetDefaultHandleConfig(p_config) \ +{\ + (p_config)->readbuffer_size = 0;\ +} + +/*************************************************************************** + * Enum declaration + ***************************************************************************/ +/*EN + * \brief Speaker index of CRI Movie PCM output + * \ingroup MDL_MV_OPTION + */ +/*JP + * \brief CRI Movie のPCM出力のスピーカー配置 + * \ingroup MDL_MV_OPTION + */ +typedef enum { + CRIMV_PCM_BUFFER_L = 0, /*EN< The LEFT channel of CRI Movie output */ + /*JP< CRI Movie オーディオ出力の LEFT チャンネル */ + CRIMV_PCM_BUFFER_R = 1, /*EN< The RIGHT channel of CRI Movie output */ + /*JP< CRI Movie オーディオ出力の RIGHT チャンネル */ + CRIMV_PCM_BUFFER_LS = 2, /*EN< The Surround LEFT channel of CRI Movie output */ + /*JP< CRI Movie オーディオ出力の Surround LEFT チャンネル */ + CRIMV_PCM_BUFFER_RS = 3, /*EN< The Surround RIGHT channel of CRI Movie output */ + /*JP< CRI Movie オーディオ出力の Surround RIGHT チャンネル */ + CRIMV_PCM_BUFFER_C = 4, /*EN< The CENTER channel of CRI Movie output */ + /*JP< CRI Movie オーディオ出力の CENTER チャンネル */ + CRIMV_PCM_BUFFER_LFE = 5, /*EN< The LFE channel of CRI Movie output */ + /*JP< CRI Movie オーディオ出力の LFE チャンネル */ + CRIMV_PCM_BUFFER_EXT1 = 6, /*EN< The EXT1(Rear Left) channel of CRI Movie output */ + /*JP< CRI Movie オーディオ出力の EXT1(Rear Left) チャンネル */ + CRIMV_PCM_BUFFER_EXT2 = 7, /*EN< The EXT2(Rear Right) channel of CRI Movie output */ + /*JP< CRI Movie オーディオ出力の EXT2(Rear Right) チャンネル */ + + /* Keep enum 4bytes */ + CRIMV_PCM_BUFFER_MAKE_ENUM_SINT32 = 0x7FFFFFFF +} CriMvPcmBufferIndex; + + +/*EN + * \brief Composite mode of alpha movie + * \ingroup MDL_MV_OPTION + */ +/*JP + * \brief アルファムービの合成モード + * \ingroup MDL_MV_OPTION + */ +typedef enum { + CRIMV_COMPO_OPAQ = 0, /*EN< Opacity, no alpha value */ + /*JP< 不透明、アルファ情報なし */ + CRIMV_COMPO_ALPHFULL = 1, /*EN< Full alpha blending (8bits-alpha data) */ + /*JP< フルAlpha合成(アルファ用データが8ビット) */ + CRIMV_COMPO_ALPH3STEP = 2, /*EN< 3 Step Alpha */ + /*JP< 3値アルファ */ + CRIMV_COMPO_ALPH32BIT = 3, /*EN< Full alpha blending (32bits color + alpha data) */ + /*JP< フルAlpha、(カラーとアルファデータで32ビット) */ + CRIMV_COMPO_ALPH1BIT = 4, /*EN< Alpha blending (24bits color + 1->8bits alpha) */ + /*JP< フルAlpha、(カラーとアルファデータで32bit、値は2値) */ + CRIMV_COMPO_ALPH2BIT = 5, /*EN< Alpha blending (24bits color + 2->8bits alpha) */ + /*JP< フルAlpha、(カラーとアルファデータで32bit、値は4値) */ + CRIMV_COMPO_ALPH3BIT = 6, /*EN< Alpha blending (24bits color + 3->8bits alpha) */ + /*JP< フルAlpha、(カラーとアルファデータで32bit、値は8値) */ + CRIMV_COMPO_ALPH4BIT = 7, /*EN< Alpha blending (24bits color + 4->8bits alpha) */ + /*JP< フルAlpha、(カラーとアルファデータで32bit、値は16値)*/ + + /* Keep enum 4bytes */ + CRIMV_COMPO_MAKE_ENUM_SINT32 = 0x7FFFFFFF +} CriMvAlphaType; + + +/*EN + * \brief Result of the last video frame retrieval + * \ingroup MDL_MV_OPTION + */ +/*JP + * \brief 前回のビデオフレーム取得の結果 + * \ingroup MDL_MV_OPTION + */ +typedef enum { + CRIMV_LASTFRAME_OK = 0, /*EN< Succeeded */ + /*JP< 取得成功 */ + CRIMV_LASTFRAME_TIME_EARLY = 1, /*EN< Failed. The frame is not yet the time to draw */ + /*JP< 取得失敗。フレーム表示時刻が再生時間に達していなかった */ + CRIMV_LASTFRAME_DECODE_DELAY = 2, /*EN< Failed. The frame to draw is not decoded yet */ + /*JP< 取得失敗。ビデオフレームのデコードが間に合わなかった */ + CRIMV_LASTFRAME_DISCARDED = 3, /*EN< Failed. The video frame is discarded by app */ + /*JP< 取得失敗。アプリによって破棄された */ + //CRIMV_LASTFRAME_NO_INPUT_DATA = 4, //Not supported yet + //CRIMV_LASTFRAME_SKIPPED = 5, //Not supported yet + //CRIMV_LASTFRAME_DEMUX_STUCKED = 6, //Not supported yet + + /* Keep enum 4bytes */ + CRIMV_LASTFRAME_MAKE_ENUM_SINT32 = 0x7FFFFFFF +} CriMvLastFrameResult; + +#if defined(XPT_TGT_PS3PPU) +/*EN + * \brief Graphic Environment type for PS3 + * \ingroup MDL_MV_OPTION + */ +/*JP + * \brief PS3のグラフィック環境 + * \ingroup MDL_MV_OPTION + */ +typedef enum { + CRIMV_GRAPHIC_ENV_GCM = 0, /*EN< GCM. (or same ARGB 32bit texture format of GCM) */ + /*JP< GCM環境 (またはテクスチャフォーマットがGCMと同じ環境) */ + CRIMV_GRAPHIC_ENV_PSGL = 1, /*EN< PSGL. (or same ARGB 32bit texture format of PSGL) */ + /*JP< PSGL環境 (またはテクスチャフォーマットがPSGLと同じ環境) */ + + /* Keep enum 4bytes */ + CRIMV_GRAPHIC_ENV_MAKE_ENUM_SINT32 = 0x7FFFFFFF +} CriMvGraphicEnv; +#endif + + +/* CRI Movie Interanl handle status + * + * The possible legal states of a CriMvPly handle. Over the course of your application + * the CriMvPly handle will walk through the following states in roughly the following + * order. In states that are waiting states, you can request the + * CriMvPly handle to advance to the next state by calling the criMvPly_IncrementState() + * function. You can check the status of a valid CriMvPly handle at any time + * by calling criMvPly_GetStatus(). + * + * It is not possible to jump from a state to an arbitrary other state. Normal play + * proceeds from the CRIMVPLY_STATUS_STOP state through the CRIMV_PLY_STATUS_PLAYEND + * state in that order. Premature termination can be requested with the criMvPly_Stop() + * function. + * + * \sa criMvPly_IncrementState(), criMvPly_GetStatus(), criMvPly_Stop() + */ +typedef enum { + CRIMVPLY_STATUS_STOP = 0, /* Standstill. No processing is occurring. + * CriMvPly handles are created into this state. + */ + /* 停止中 */ + CRIMVPLY_STATUS_DECHDR = 1, /* The CriMvPly structure is now parsing the header + * of the file, including information on height and width + * of the video stream. + */ + /* ヘッダ解析中 */ + CRIMVPLY_STATUS_WAIT_PREP = 2, /* The header has been decoded and criMvPly_GetStreamingParameters() + * will now provide valid values. Typically you will call + * criMvPly_AllocateWorkBuffer() with this information at this point. + */ + /* PREP状態へのIncrementState待ち
+ AllocateWorkBufferしてから次へいくこと */ + CRIMVPLY_STATUS_PREP = 3, /* Transition to this state to acknowledge to the + * CriMvPly handle that you have allocated your work buffers. */ + /* 再生準備中 */ + CRIMVPLY_STATUS_WAIT_PLAYING = 4, /* The audio and video decoders are now ready to begin playback.*/ + /* PLAYING状態へのIncrementState待ち
+ この状態で既にビデオとオーディオのデコード結果は取得できる。*/ + CRIMVPLY_STATUS_PLAYING = 5, /* The decoders are currently decoding and playing output. */ + /* 再生中 */ + CRIMVPLY_STATUS_WAIT_PLAYEND = 6, /* The library is waiting for you to acknowledge the end of the movie. You + * have informed the CriMvPly structure that an end-of-file condition exists, + * but final frames of video and audio may still be pending in your application. */ + /* PLAYEND状態へのIncrementState待ち */ + CRIMVPLY_STATUS_PLAYEND = 7, /* You have acknowledged the end of the movie. Teardown can occur at this point. */ + /* 再生終了 */ + CRIMVPLY_STATUS_STOP_PROCESSING = 8, /* A request to stop has been received by the CriMvPly structure, + * that is, you have called criMvPly_Stop(), and a stop is now pending. */ + /* 停止処理中 */ + CRIMVPLY_STATUS_WAIT_STOP = 9, /* The CriMvPly handle has acknowledged the stop request and + * you may now call criMvPly_IncrementState() to transition to + * the CRIMVPLY_STATUS_STOP state. */ + /* STOP状態へのIncrementState待ち */ + CRIMVPLY_STATUS_ERROR = 10, /* An error has occurred. */ + /* エラー */ + + /* Keep enum 4bytes */ + CRIMVPLY_STATUS_MAKE_ENUM_SINT32 = 0x7FFFFFFF +} CriMvPlyStatus; + + +/* Sofdec2 */ +typedef enum { + CRIMVPLY_META_FLAG_OFF = 0x0000, + CRIMVPLY_META_FLAG_CUE = 0x0001, + CRIMVPLY_META_FLAG_SEEK = 0x0002, + CRIMVPLY_META_FLAG_ALL = CRIMVPLY_META_FLAG_CUE + CRIMVPLY_META_FLAG_SEEK, + + /* Keep enum 4bytes */ + CRIMVPLY_META_FLAG_MAKE_ENUM_SINT32 = 0x7FFFFFFF +} CriMvMetaFlag; + +/* Color Conversion*/ +typedef enum{ + CRIMV_COLORSPACE_CONVERSION_TYPE_ITU_R_BT601_LIMITED = 0, + CRIMV_COLORSPACE_CONVERSION_TYPE_ITU_R_BT601_FULLRANGE = 1, + + /* Keep enum 4bytes */ + CRIMV_COLORSPACE_CONVERSION_TYPE_ENUM_SINT32 = 0x7FFFFFFF +}CriMvColorSpaceConversionType; + +typedef void *(*CriMvMetaDataWorkMallocFunc)(void *obj, CriUint32 size); +typedef void (*CriMvMetaDataWorkFreeFunc)(void *obj, void *mem); + +/* OUTER_FRAMEPOOL_WORK */ +#define CriMvFramepoolWorkMallocFunc CriMvMetaDataWorkMallocFunc +#define CriMvFramepoolWorkFreeFunc CriMvMetaDataWorkFreeFunc + +/*************************************************************************** + * Data type declaration + ***************************************************************************/ + +/*EN + * \brief Audio parameters + * \ingroup MDL_MV_INFO + * + * \sa CriMvStreamingParameters, CriMvWaveInfo + */ +/*JP + * \brief オーディオパラメータ + * \ingroup MDL_MV_INFO + * + * オーディオストリームのパラメータ + * \sa CriMvStreamingParameters, CriMvWaveInfo + */ +typedef struct { + CriUint32 sampling_rate; /*EN< Sampling rate */ + /*JP< サンプリング周波数 */ + CriUint32 num_channel; /*EN< Number of channels. Monaural = 1, Stereo = 2 */ + /*JP< オーディオチャネル数 */ + CriUint32 total_samples; /*EN< Total number of samples */ + /*JP< 総サンプル数 */ + CriUint32 output_buffer_samples; /*EN< Output wave buffer size */ + /*JP< サウンド出力バッファのサンプル数 */ + CriUint32 codec_type; /*EN< Codec type */ + /*JP< コーデック種別 */ + +} CriMvAudioParameters; + +/*EN + * \brief Video Parameters + * \ingroup MDL_MV_INFO + * \sa CriMvStreamingParameters + */ +/*JP + * \brief ビデオパラメータ + * \ingroup MDL_MV_INFO + * ビデオストリームのパラメータ + * \sa CriMvStreamingParameters + */ +typedef struct { + CriUint32 max_width; /*EN< Maximum video width for stream. (multiple of 8) */ + /*JP< ムービ最大幅(8の倍数) */ + CriUint32 max_height; /*EN< Maximum video height for stream. (multiple of 8)*/ + /*JP< ムービ最大高さ(8の倍数) */ + CriUint32 disp_width; /*EN< Width of the image to draw. */ + /*JP< 表示したい映像の横ピクセル数(左端から) */ + CriUint32 disp_height; /*EN< Height of the image to draw. */ + /*JP< 表示したい映像の縦ピクセル数(上端から) */ + CriUint32 num_frame_pool; /*EN< Number of frame pools required for stream */ + /*JP< フレームプール数 */ + CriUint32 framerate; /*EN< Frame rate per second [x1000]. */ + /*JP< フレームレート[x1000] */ + CriUint32 framerate_n; /*EN< Frame rate (in rational as numerator). framerate_n/framerate_d = framerate */ /* UTODO: 変数名 */ + /*JP< フレームレートの分子(有理数形式)。framerate_n/framerate_d = framerate */ + CriUint32 framerate_d; /*EN< Frame rate (in rational as denominator). */ + /*JP< フレームレートの分母(有理数形式)。 */ + CriUint32 total_frames; /*EN< Total number of video frames */ + /*JP< 総フレーム数 */ + + CriUint32 material_width; /*EN< Width of the video source resolustion before encoding. */ + /*JP< エンコード前のビデオ素材の横ピクセル数 */ + CriUint32 material_height; /*EN< Height of the video source resolustion before encoding. */ + /*JP< エンコード前のビデオ素材の縦ピクセル数 */ + CriUint32 screen_width; /*EN< Screen width set by encoding and cropping. + * This parameter is only available when you encoded the movie with "Widescreen TV Support" option. + * Normally this value is 0. */ + /*JP< エンコード時に指定したスクリーン幅。 + * この値はエンコード時に「ワイドテレビ支援機能」を使用した場合のみ有効になります。 + * 通常は0です。 */ + + CriUint32 codec_type; /*EN< Video Codec Type. If you encoded the movie for PS2, this value is 2. + * Normally this value is 1 or 0(no info). + * If the codec_type is 1, the CRI Movie for ONLY PS2 can play the movie file. */ + /*JP< ビデオコーデック種別。PS2用にエンコードした場合 2になります。 + * 通常は 1または 0(情報無し)です。 + * コーデック種別が2のムービは、PS2版ライブラリで「のみ」再生可能です。 */ + CriUint32 codec_dc_option; /*EN< Video Codec DC Option. If you encoded the movie for PS2, this value is 10. + * Normally this value is 11 or 0(no info). + * If the codec_type is 11, the CRI Movie for PS2 can NOT play the movie file. */ + /*JP< ビデオコーデックのDCオプション種別。PS2用にエンコードした場合10になります。 + * 通常は11または 0(情報無し)です。 + * コーデックDCオプションが11のムービは、PS2版ライブラリ「では」再生できません。 */ + CriUint32 color_conversion_type; /*EN< Color space converion type. Fullrange or Limited.*/ + /*JP< 色変換タイプ。 */ + CriSint32 capacity_of_picsize; /*EN< Capacity size of video pictures. */ + /*JP< ピクチャサイズ上限値 */ + CriUint32 average_bitrate; /*EN< Average bitrate. */ + /*JP< 平均ビットレート */ +} CriMvVideoParameters; + +/*EN + * \brief Alpha Parameters + * \ingroup MDL_MV_INFO + * \sa CriMvStreamingParameters + */ +/*JP + * \brief アルファパラメータ + * \ingroup MDL_MV_INFO + * アルファストリームのパラメータ + * \sa CriMvStreamingParameters + */ +typedef struct { + CriUint32 max_width; /*EN< Maximum alpha width for stream */ + /*JP< アルファフレームの最大幅 */ + CriUint32 max_height; /*EN< Maximum alpha height for stream */ + /*JP< アルファフレームの最大高さ */ + CriUint32 disp_width; /*EN< valid alpha width */ + /*JP< アルファフレームの実有効幅 */ + CriUint32 disp_height; /*EN< valid alpha height */ + /*JP< アルファフレームの実有効高さ */ + CriUint32 framerate; /*EN< Frame rate per second [x1000]. */ + /*JP< アルファのフレームレート[x1000] */ + CriUint32 framerate_n; /*EN< Frame rate (in rational as numerator). framerate_n/framerate_d = framerate */ /* UTODO: 変数名 */ + /*JP< フレームレートの分子(有理数形式)。framerate_n/framerate_d = framerate */ + CriUint32 framerate_d; /*EN< Frame rate (in rational as denominator). */ + /*JP< フレームレートの分母(有理数形式)。 */ + CriUint32 total_frames; /*EN< Total number of alpha frames */ + /*JP< 総フレーム数 */ + CriMvAlphaType alpha_type; /*EN< Alpha Composite Type. */ + /*JP< アルファ合成種別。 */ + CriUint32 codec_type; /*EN< Internal use only. Do not access this */ + /*JP< ライブラリ内部使用変数 */ + CriUint32 color_conversion_type; /*EN< Color space converion type. Fullrange or Limited.*/ + /*JP< 色変換タイプ。 */ + CriSint32 capacity_of_picsize; /*EN< Capacity size of video pictures. */ + /*JP< ピクチャサイズ上限値 */ + CriUint32 average_bitrate; /*EN< Average bitrate. */ + /*JP< 平均ビットレート */ +} CriMvAlphaParameters; + + +/*EN + * \brief Streaming Parameters + * \ingroup MDL_MV_INFO + * This structure includes streaming parameters and playing parameters. + * \sa CriMvEasyPlayer::GetMovieInfo() + */ +/*JP + * \brief ストリーミング再生パラメータ + * \ingroup MDL_MV_INFO + * ストリーミング再生パラメータ。
+ * ストリーム自体の情報と、再生のために必要なパラメータの両方を含んでいる。 + * \sa CriMvEasyPlayer::GetMovieInfo() + */ +typedef struct { + /* Stream */ + CriUint32 is_playable; /*EN< Flag of the movie file is playable or not. 1 is playable. 0 is not playable.*/ + /*JP< 再生可能フラグ(1: 再生可能、0: 再生不可) */ + CriFloat32 buffering_time; /*EN< Amount of time to buffer in the stream, in seconds */ + /*JP< 読み込みデータのバッファリング時間。単位[sec]。 */ + CriUint32 max_bitrate; /*EN< Maximum bits per second for stream. This value includes video and audio both. */ + /*JP< 最大ビットレート(絵と音の合計) */ + CriUint32 max_chunk_size; /*EN< Maximum chunk size of incoming stream (USF) file */ + /*JP< 最大USFチャンクサイズ */ + CriUint32 min_buffer_size; /*EN< Minimum buffer size for reading */ + /*JP< 最低限必要な読み込みバッファサイズ。
オーディオとビデオの合計 */ + CriSint32 read_buffer_size; /*EN< Input buffer size for reading data */ + /*JP< リードバッファサイズ */ + /* Video */ + CriUint32 num_video; /*EN< Number of simultaneous video streams */ + /*JP< ビデオデコーダの数。現在は1固定。*/ + CriMvVideoParameters video_prm[CRIMV_MAX_VIDEO_NUM]; /*EN< Video parameters see CriMvVideoParameters struct for details */ + /*JP< ビデオパラメータ */ + /* Audio */ + CriUint32 num_audio; /*EN< Number of simultaneous audio streams */ + /*JP< オーディオデコーダの数。現在は1固定。*/ + CriSint32 track_play_audio; /*EN< Track of audio playback. */ + /*JP< 再生するオーディオチャネル番号。-1指定で再生無し。 */ + CriMvAudioParameters audio_prm[CRIMV_MAX_AUDIO_NUM]; /*EN< Audio parameters see CriMvAudioParameters struct for details */ + /*JP< オーディオパラメータ */ + /* Subtitle */ + CriUint32 num_subtitle; /*EN< Number of subtitles */ + /*JP< 字幕チャネル数 */ + CriSint32 channel_play_subtitle; /*EN< Channel for playing subtitles */ + /*JP< 再生する字幕チャネル番号 */ + CriUint32 max_subtitle_size; /*EN< Maximum size of subtitle data */ + /*JP< 字幕データの最大サイズ*/ + + /* Composite mode */ + CriUint32 num_alpha; /*EN< Number of alpha channels (current spec allows only one) */ + /*JP< アルファデコーダの数。現在は1固定。 */ + CriMvAlphaParameters alpha_prm[CRIMV_MAX_ALPHA_NUM]; /*EN< Alpha parameters see CriMvAlphaParameters struct for details */ + /*JP< アルファパラメータ */ + + CriBool seekinfo_flag; /*EN< Flag of the movie file inclues seek info */ + /*JP< シーク情報フラグ */ + CriUint32 format_ver; /*EN< Format version */ + /*JP< フォーマットバージョン */ +} CriMvStreamingParameters; + + +/*EN + * \brief Input Buffer Information + * \ingroup MDL_MV_INFO + * \sa CriMvEasyPlayer::GetInputBufferInfo(), + * CriMvEasyPlayer::SetReloadThresholdTime(), CriMvEasyPlayer::SetBufferingTime() + */ +/*JP + * \brief 入力バッファ情報 + * \ingroup MDL_MV_INFO + * \sa CriMvEasyPlayer::GetInputBufferInfo(), + * CriMvEasyPlayer::SetReloadThresholdTime(), CriMvEasyPlayer::SetBufferingTime() + */ +typedef struct { + CriUint32 buffer_size; /*EN< Input buffer size [byte] */ + /*JP< 入力バッファサイズ[byte] */ + CriUint32 data_size; /*EN< Data size in input buffer[byte] */ + /*JP< 入力バッファにあるデータサイズ[byte] */ + CriUint32 reload_threshold; /*EN< Re-load threshold. When data size is less than re-load threshold, next read is requested. */ + /*JP< 再読み込み閾値[byte]。データサイズがこの値以下になると読み込みを行います。 */ +} CriMvInputBufferInfo; + + +// TEMP: for internal use +typedef struct { + CriUint8 *imageptr; + CriUint32 bufsize; // [Byte] + CriUint32 line_pitch; // [Byte] + CriUint32 line_size; // [Byte] + CriUint32 num_lines; +} CriMvImageBufferInfo; + +/*EN + * \brief Video Frame Information + * \ingroup MDL_MV_INFO + * \sa CriMvEasyPlayer::GetFrameOnTimeAs32bitARGB(), CriMvEasyPlayer::GetFrameOnTimeAsYUVBuffers, + * CriMvEasyPlayer::GetFrameOnTimeAsYUV422(), CriMvEasyPlayer::DiscardNextFrame() + */ +/*JP + * \brief ビデオフレーム情報 + * \ingroup MDL_MV_INFO + * ビデオフレーム情報 + * \sa CriMvEasyPlayer::GetFrameOnTimeAs32bitARGB(), CriMvEasyPlayer::GetFrameOnTimeAsYUVBuffers, + * CriMvEasyPlayer::GetFrameOnTimeAsYUV422(), CriMvEasyPlayer::DiscardNextFrame() + */ +typedef struct { + CriUint8 *imageptr; /*EN< Pointer to image data */ + /*JP< 画像データのポインタ */ + CriSint32 frame_id; /*EN< Frame ID ot the playback */ + /*JP< フレーム識別ID(ループ/連結再生時は通算) */ + CriUint32 width; /*EN< Width of movie frame [pixel] (multiple of 8) */ + /*JP< ムービの横幅[pixel] (8の倍数) */ + CriUint32 height; /*EN< Height of movie frame [pixel] (multiple of 8) */ + /*JP< ムービの高さ[pixel] (8の倍数) */ + CriUint32 pitch; /*EN< Pitch of movie frame [byte]*/ + /*JP< ムービのピッチ[byte] */ + CriUint32 disp_width; /*EN< Width of the image to draw. */ + /*JP< 表示したい映像の横ピクセル数(左端から) */ + CriUint32 disp_height; /*EN< Height of the image to draw. */ + /*JP< 表示したい映像の縦ピクセル数(上端から) */ + CriUint32 framerate; /*EN< Frames per second times 1000 */ + /*JP< フレームレートの1000倍の値 */ + CriUint32 framerate_n; /*EN< Frame rate (in rational as numerator). framerate_n/framerate_d = framerate */ /* UTODO: 変数名 */ + /*JP< フレームレートの分子(有理数形式)。framerate_n/framerate_d = framerate */ + CriUint32 framerate_d; /*EN< Frame rate (in rational as denominator). */ + /*JP< フレームレートの分母(有理数形式)。 */ + CriUint64 time; /*EN< Frame time ('time / tunit' indicates time in seconds) */ + /*JP< 時刻。time / tunit で秒を表す。 */ + CriUint64 tunit; /*EN< Unit of time measurement */ + /*JP< 時刻単位 */ + CriUint32 cnt_concatenated_movie; /*EN< Number of concatenated movie data */ + /*JP< ムービの連結回数 */ + CriSint32 frame_id_per_data; /*EN< Frame ID of the movie data */ + /*JP< ムービデータごとのフレーム番号 */ + + CriBool csc_flag; /*EN< This is temporary variable. Please don't access. */ + /*JP< テスト中の変数です。アクセスしないでください。 */ + + CriMvAlphaType alpha_type; /*EN< Composite mode */ + /*JP< アルファの合成モード*/ + + void *details_ptr[CRIMV_FRAME_DETAILS_NUM]; // for internal use + + CriSint32 num_images; // TEMP: for internal use + CriMvImageBufferInfo image_info[4]; // TEMP: for internal use + + CriUint32 color_conversion_type; /*EN< Color space converion type. Fullrange or Limited.*/ + /*JP< 色変換タイプ。 */ + CriUint32 total_frames_per_data; /* EN< Total frames of the movie data*/ + /*JP< ムービデータ単位の総フレーム数 */ +} CriMvFrameInfo; + +/*EN + * \brief Subtitle Information + * \ingroup MDL_MV_INFO + * \sa CriMvEasyPlayer::GetSubtitleOnTime() + */ +/*JP + * \brief 字幕情報 + * \ingroup MDL_MV_INFO + * \sa CriMvEasyPlayer::GetSubtitleOnTime() + */ +typedef struct { + CriUint8 *dataptr; /*EN< Pointer to subtitle data */ + /*JP< 字幕データのポインタ */ + CriUint32 data_size; /*EN< Size of subtitle data */ + /*JP< 字幕データサイズ */ + CriSint32 channel_no; /*EN< Channel number of subtitle data */ + /*JP< 字幕データのチャネル番号 */ + CriUint64 time_unit; /*EN< Unit of time measurement */ + /*JP< 時刻単位 */ + CriUint64 in_time; /*EN< Display start time */ + /*JP< 表示開始時刻*/ + CriUint64 duration_time; /*EN< Display duration time */ + /*JP< 表示持続時間 */ + CriUint32 cnt_concatenated_movie; /*EN< Number of concatenated movie data */ + /*JP< ムービの連結回数 */ + CriUint64 in_time_per_data; /*EN< Display start time per movie data*/ + /*JP< ムービデータごとに表示開始時刻*/ +} CriMvSubtitleInfo; + +/*EN + * \brief Event Point Info + * \ingroup MDL_MV_INFO + * Event point info is the each timing info was embeded to movie data as cue point info. + * \sa CriMvEasyPlayer::GetCuePointInfo() + */ +/*JP + * \brief イベントポイント情報 + * \ingroup MDL_MV_INFO + * キューポイント機能でムービデータに埋め込まれた個々のタイミング情報です。 + * \sa CriMvEasyPlayer::GetCuePointInfo() + */ +typedef struct { + CriChar8 *cue_name; /*EN< The name string of event point. Char code depends on cue point text. */ + /*JP< イベントポイント名。文字コードはキューポイント情報テキストに従います。 */ + CriUint32 size_name; /*EN< The data size of name string */ + /*JP< イベントポイント名のデータサイズ */ + CriUint64 time; /*EN< Timer counter */ + /*JP< タイマカウント */ + CriUint64 tunit; /*EN< Counter per 1 second. "count / unit" indicates the timer on the second time scale. */ + /*JP< 1秒あたりのタイマカウント値。count ÷ unit で秒単位の時刻となります。 */ + CriSint32 type; /*EN< Event point type */ + /*JP< イベントポイント種別 */ + CriChar8 *param_string; /*EN< The string of user parameters. Char code depends on cue point text. */ + /*JP< ユーザパラメータ文字列。文字コードはキューポイント情報テキストに従います。 */ + CriUint32 size_param; /*EN< The data size of user parameters string */ + /*JP< ユーザパラメータ文字列のデータサイズ */ + CriUint32 cnt_callback; /*EN< The counter of calling cue point callback. */ + /*JP< キューポイントコールバックの呼び出しカウンタ */ +} CriMvEventPoint; + +/*EN + * \brief Cue Point Info + * \ingroup MDL_MV_INFO + * Cue point info includes the number of event points and the list. + * \sa CriMvEasyPlayer::GetCuePointInfo() + */ +/*JP + * \brief キューポイント情報 + * \ingroup MDL_MV_INFO + * キューポイント情報は、イベントポイントの個数と一覧です。
+ * \sa CriMvEasyPlayer::GetCuePointInfo() + */ +typedef struct { + CriUint32 num_eventpoint; /*EN< The number of event points */ + /*JP< イベントポイント個数 */ + CriMvEventPoint *eventtable; /*EN< The list of event points */ + /*JP< イベントポイント一覧 */ +} CriMvCuePointInfo; + +/*EN + * \brief YUV Texture Buffer Parameters + * \ingroup MDL_MV_INFO + * The output buffer parameters for CriMvEasyPlayer::GetFrameOnTimeAsYUVBuffers(). + * CriMvEasyPlayer::GetFrameOnTimeAsYUVBuffers() outputs data for pixel shader.
+ * If an application doesn't play alpha movie, CRI Movie library doesn't use alpha buffer parameters.
+ * \sa CriMvEasyPlayer::GetFrameOnTimeAsYUVBuffers() + */ +/*JP + * \brief YUV個別バッファ情報 + * \ingroup MDL_MV_INFO + * CriMvEasyPlayer::GetFrameOnTimeAsYUVBuffers() の出力バッファ情報です。
+ * CriMvEasyPlayer::GetFrameOnTimeAsYUVBuffers() はPixel Shader 向けのデコード結果を出力します。
+ * アルファムービ再生を行わない場合(不透明の通常再生)は、Alphaテクスチャ関連のパラメータは使用しません。
+ * \sa CriMvEasyPlayer::GetFrameOnTimeAsYUVBuffers() + */ +typedef struct { + CriUint8 *y_imagebuf; /*EN< Pointer to the buffer of Y texture */ + /*JP< Yテクスチャのバッファポインタ */ + CriUint32 y_bufsize; /*EN< Size of the buffer of Y texture [byte] */ + /*JP< Yテクスチャのバッファサイズ[byte] */ + CriUint32 y_pitch; /*EN< Pitch of the buffer of Y texture [byte] */ + /*JP< Yテクスチャのピッチ[byte] */ + CriUint8 *u_imagebuf; /*EN< Pointer to the buffer of U texture */ + /*JP< Uテクスチャのバッファポインタ */ + CriUint32 u_bufsize; /*EN< Size of the buffer of U texture [byte] */ + /*JP< Uテクスチャのバッファサイズ[byte] */ + CriUint32 u_pitch; /*EN< Pitch of the buffer of U texture [byte] */ + /*JP< Uテクスチャのピッチ[byte] */ + CriUint8 *v_imagebuf; /*EN< Pointer to the buffer of V texture */ + /*JP< Vテクスチャのバッファポインタ */ + CriUint32 v_bufsize; /*EN< Size of the buffer of V texture [byte] */ + /*JP< Vテクスチャのバッファサイズ[byte] */ + CriUint32 v_pitch; /*EN< Pitch of the buffer of V texture [byte] */ + /*JP< Vテクスチャのピッチ[byte] */ + CriUint8 *a_imagebuf; /*EN< Pointer to the buffer of Alpha texture */ + /*JP< Alphaテクスチャのバッファポインタ */ + CriUint32 a_bufsize; /*EN< Size of the buffer of Alpha texture [byte] */ + /*JP< Alphaテクスチャのバッファサイズ[byte] */ + CriUint32 a_pitch; /*EN< Pitch of the buffer of Alpha texture [byte] */ + /*JP< Alphaテクスチャのピッチ[byte] */ +} CriMvYuvBuffers; + + +/*EN + * \brief Playback Information + * \ingroup MDL_MV_INFO + * The output playback information of CriMvEasyPlayer::GetPlaybackInfo(). + * These parameters represents current movie playback information such as decode delay of movie data and + * interval of video frames retrieval. + * \sa CriMvEasyPlayer::GetPlaybackInfo() + */ +/*JP + * \brief 再生情報 + * \ingroup MDL_MV_INFO + * CriMvEasyPlayer::GetPlaybackInfo() の出力再生情報です。
+ * フレームの取得間隔やデコードの遅延などの現在再生しているムービの再生情報を表します。
+ * \sa CriMvEasyPlayer::GetPlaybackInfo() + */ +typedef struct { + CriUint64 cnt_app_loop; /*EN< Loop count of application. Precisely, this is a number of calls of CriMvEasyPlayer::Update(). The count up will start after app is able to acquire the first video frame */ + /*JP< アプリケーションのループカウント。具体的には CriMvEasyPlayer::Update() の呼び出し回数になります。最初のフレームが取得可能になるとカウントが始まります。*/ + CriUint64 cnt_frame_interval[4]; /*EN< Interval of video frames retrieval. These values are count up when CriMvEasyPlayer::IsNextFrameOnTime() returns TRUE. + * + * The interval of video frames retrieval indicates a number of the loop count when your application calls CriMvEasyPlayer::IsNextFrameOnTime() in the main loop. + * In case that the application waits for vertical retrace, 1 interval equals about 16.7 msec. + * The index of array represents the count of intervals as follows: + * + *
Index Interval of video frames retrieval + *
0 Every main loop + *
1 2 main loops + *
2 3 main loops + *
3 4 or more main loops + *
+ * With these values, you can check if the application gets video frames with appropriate intervals. Please use the values as measuring playback smoothness + * + * In order to use these values, the application must meet the following conditions: + * - The main loop should work periodically and stably (Ideally sync with vertical retrace) + * - The application should call CriMvEasyPlayer::IsNextFrameOnTime() once in everly main loop + * + * For example, if the application runs at 59.94fps by waiting for vertical retrace and a framerate of playing movie file is 29.97fps, + * only cnt_frame_interval[1] should be increased. + */ + /*JP< フレームの取得間隔。これらの値は、 CriMvEasyPlayer::IsNextFrameOnTime() がTRUEを返した時にカウントアップされます。
+ * + * フレームの取得間隔とは、アプリケーションがメインループ内でフレーム取得関数を読んだ時のループの回数を意味します。 + * メインループがVSyncと同期している場合は、1 Interval = 約16.7msecということになります。 + * 配列のインデックスは、以下のように取得間隔を表します。
+ * + *
インデックス フレームの取得間隔 + *
0 毎メインループ + *
1 2 メインループ + *
2 3 メインループ + *
3 4 メインループ以上 + *
+ * これらの値を見ることで、アプリが正しい間隔でフレームを取得できたのかどうかをチェックすることができます。ムービが滑らかに再生できているかの目安にしてください。
+ * + * ただし前提として、以下の条件をアプリが満たしている必要があります。 + * - アプリがVSyncなど、一定の周期で安定して動作している + * - メインループ内で毎回 CriMvEasyPlayer::IsNextFrameOnTime() を呼び出す + * + * 上記の条件下において、例えばアプリが59.94fpsで動作している状態で、フレームレートが29.97fpsのムービを再生した場合、cnt_frame_interval[1]のみが増え続けれれば + * 正しい間隔でフレームの取得が出来たことになります。 + */ + CriUint64 cnt_time_early; /*EN< A count of how many times CriMvEasyPlayer::IsNextFrameOnTime() returns FALSE due to the determination if it is the time to provide the next video frame */ + /*JP< CriMvEasyPlayer::IsNextFrameOnTime() が、フレーム表示時刻判定によりFALSEを返した回数。*/ + CriUint64 cnt_decode_delay; /*EN< A count of how many times CriMvEasyPlayer::IsNextFrameOnTime() returns FALSE due to the delay of decoding movie data */ + /*JP< CriMvEasyPlayer::IsNextFrameOnTime()が、ビデオフレームのデコード遅延によりFALSEを返した回数 */ + CriFloat32 time_max_delay; /*EN< Maximum delay time [msec] of the actual time a video frame retrieved against the original time should be retrieved */ + /*JP< ビデオフレームを取得した実際の時刻と、本来表示すべき時刻との最大遅延時間 [msec]。 */ + CriFloat32 time_average_delay; /*EN< Average delay time [msec] of the actual time a video frame retrieved against the original time should be retrieved */ + /*JP< ビデオフレームを取得した実際の時刻と、本来表示すべき時刻との平均遅延時間 [msec]。 */ +} CriMvPlaybackInfo; + +#if defined(XPT_TGT_PS3PPU) +/*EN + * \brief Parameters of SPURS and PPU for decoding + * \ingroup MDL_MV_BASIC + * + * \sa CriMv::SetupSpursParameters_PS3(), CriMv::CalcSpursWorkSize_PS3() + */ +/*JP + * \brief デコードに使うSPURSおよびPPUのパラメータ + * \ingroup MDL_MV_BASIC + * + * \sa CriMv::SetupSpursParameters_PS3(), CriMv::CalcSpursWorkSize_PS3() + */ +typedef struct { + void *spurs_handler; /*EN< SPURS handler */ + /*JP< SPURSハンドル */ + void *spurs_work; /*EN< SPURS work area. The size is spurs_worksize. The alignment is 128 byte. */ + /*JP< SPURS用ワークバッファ。バッファサイズは spurs_worksize で128バイト境界。 */ + CriSint32 spurs_worksize; /*EN< SPURS work size. This size is calculated by CriMv::CalcSpursWorkSize_PS3 function. */ + /*JP< SPURS用ワークサイズ。CriMv::CalcSpursWorkSize_PS3 関数で取得した値。 */ + CriSint32 spurs_max_contention; /*EN< SPURS max contention */ + /*JP< SPURS でムービデコード用に使うSPUの最大数 */ + CriUint8 *spurs_task_priority; /*EN< SPURS task priority x 8 */ + /*JP< SPURS のタスクプライオリティ配列。配列要素は8個。 */ + + CriUint32 ppu_num; /*EN< The number of PPU for decoding (0-2) */ + /*JP< The number of PPU for decoding (0-2) */ + CriSint32 ppu_thread_prio; /*EN< PPU Thread Priority. This priority is used for decoding thread in the case of ppu_num equal 2. */ + /*JP< PPU Thread Priority. この値は ppu_num に2を指定した場合に作成するスレッドに使われる。 */ +} CriMvProcessorParameters_PS3; + +// [NOT SUPPORT on normal library] +// for SPU Thread +typedef struct { + CriUint32 ppu_num; /* The number of PPU for decoding (0-2) */ + CriSint32 ppu_prio; /* PPU Thread Priority */ + CriUint32 spu_num; /* The number of SPU for decoding (0-6) */ + CriSint32 spu_grp_prio; /* SPU Thread Group Priority */ +} CriMvSpuThreadParameters_PS3; + +#endif + +#if defined(XPT_TGT_XBOX360) +/*EN + * \brief Parameters of Xbox360 processors for decoding + * \ingroup MDL_MV_BASIC + * + * \sa CriMvEasyPlayer::SetUsableProcessors_XBOX360() + */ +/*JP + * \brief デコードに使うXbox360プロセッサのパラメータ + * \ingroup MDL_MV_BASIC + * + * \sa CriMvEasyPlayer::SetUsableProcessors_XBOX360() + */ +typedef struct { + CriBool processor0_flag; /*EN< Processor 0 (Core 0, Thread 0) usable flag */ + /*JP< プロセッサ0 (コア0スレッド0) 使用可能フラグ */ + CriBool processor1_flag; /*EN< Processor 1 (Core 0, Thread 1) usable flag */ + /*JP< プロセッサ1 (コア0スレッド1) 使用可能フラグ */ + CriBool processor2_flag; /*EN< Processor 2 (Core 1, Thread 0) usable flag */ + /*JP< プロセッサ2 (コア1スレッド0) 使用可能フラグ */ + CriBool processor3_flag; /*EN< Processor 3 (Core 1, Thread 1) usable flag */ + /*JP< プロセッサ3 (コア1スレッド1) 使用可能フラグ */ + CriBool processor4_flag; /*EN< Processor 4 (Core 2, Thread 0) usable flag */ + /*JP< プロセッサ4 (コア2スレッド0) 使用可能フラグ */ + CriBool processor5_flag; /*EN< Processor 5 (Core 2, Thread 1) usable flag */ + /*JP< プロセッサ5 (コア2スレッド1) 使用可能フラグ */ + CriSint32 thread_priority; /*EN< Priority of decoding threads on the active processors */ + /*JP< 各プロセッサ上でデコード処理を行うスレッドの優先度 */ +} CriMvProcessorParameters_XBOX360; +#endif + +#if defined(XPT_TGT_VITA) +/*EN + * \brief AVC Decoder Parameters + * \ingroup MDL_MV_BASIC + * + * \sa CriMv::SetupAvcDecoderParameters_VITA() + */ +/*JP + * \brief AVCデコーダパラメータ + * \ingroup MDL_MV_BASIC + * + * \sa CriMv::SetupAvcDecoderParameters_VITA() + */ +typedef struct { + CriUint32 horizontal; /*EN< Maximum width for decoding (in pixel) */ + /*JP< 最大デコード画像の横幅 (単位:ピクセル) */ + CriUint32 vertical; /*EN< Maximum height for decoding (in pixel) */ + /*JP< 最大デコード画像の高さ (単位:ピクセル) */ + CriUint32 n_ref_frames; /*EN< Maximum reference frames on decoding (default:3) */ + /*JP< デコード時の最大参照画像の枚数 */ + CriUint32 n_decoders; /*EN< Maximum number of avc decoders (max:1) */ + /*JP< 同時に使用するAVCでコーダの最大数 (1固定) */ + +} CriMvAvcDecoderParameters_VITA; +#endif + +/*--------------------------------------------------------------------------*/ +/* */ +/*--------------------------------------------------------------------------*/ +typedef enum { + CRIMV_PCM_FORMAT_SINT16 = 0, + CRIMV_PCM_FORMAT_FLOAT32 = 1, + + /* Keep enum 4bytes */ + CRIMV_PCM_FORMAT__MAKE_ENUM_SINT32 = 0x7FFFFFFF +} CriMvPcmFormat; +/* + * \brief 16bit wave data information + * \ingroup MDL_MV_INFO + * Information about a 16-bit waveform. + */ +/* 16bit Waveform 情報 */ +typedef struct { + CriUint32 num_channel; /* Number of Channels. monaural = 1, stereo = 2 */ + /* Number of Channels. monaural = 1, stereo = 2 */ + CriUint32 num_samples; /* Number of sample */ + /* サンプル数 */ + CriUint32 sampling_rate; /* Sampling rate */ + /* サンプリング周波数 */ +} CriMvWaveInfo; + +/* オーディオヘッダ */ +typedef struct { + /* ストリーミングパラメータと共通 */ + CriUint32 sampling_rate; + CriUint32 num_channel; + CriUint32 total_samples; + CriUint32 codec_type; + + CriUint32 metadata_count; + CriUint32 metadata_size; + + /* ヘッダ固有 */ + CriUint32 a_input_xsize; +} CriMvPlyAudioHeader; + +/* ビデオヘッダ */ +typedef struct { + /* ヘッダ固有 */ + CriUint32 width; + CriUint32 height; + CriUint32 disp_width; + CriUint32 disp_height; + CriUint32 framerate_n; + CriUint32 framerate_d; + CriUint32 total_frames; + + CriUint32 material_width; /* width of video original source. 0 means no info. */ + CriUint32 material_height; /* height of video original source. 0 means no info. */ + CriUint32 screen_width; /* screen width for Wii */ + + CriUint32 codec_type; + CriUint32 codec_dc_option; /* 11 or 10 */ + + CriUint32 metadata_count; + CriUint32 metadata_size; + + CriUint32 pre_padding; + CriUint32 color_conversion_type; + CriSint32 max_picture_size; + CriSint32 average_bitrate; +} CriMvPlyVideoHeader; + +/* サブタイトルヘッダ */ +typedef struct { + CriBool is_subtitle_data; + CriUint32 num_channel; + CriUint64 time_unit; + CriUint32 max_subtitle_size; +} CriMvPlySubtitleHeader; + +/* キューポイントヘッダ */ +typedef struct { + CriBool is_cuepoint_data; + CriUint32 metadata_count; + CriUint32 metadata_size; + CriUint32 num_eventpoint; + CriUint64 time_unit; +} CriMvPlyCuePointHeader; + +/* アルファヘッダ */ +typedef struct { + /* ヘッダ固有 */ + CriUint32 width; + CriUint32 height; + CriUint32 disp_width; + CriUint32 disp_height; + CriUint32 framerate_n; + CriUint32 framerate_d; + CriUint32 total_frames; + + CriMvAlphaType alpha_type; + CriUint32 codec_type; + + CriUint32 metadata_count; + CriUint32 metadata_size; + + CriUint32 pre_padding; + CriUint32 color_conversion_type; + CriSint32 max_picture_size; + CriSint32 average_bitrate; +} CriMvPlyAlphaHeader; + +/* アルファのみのフレーム情報 */ +typedef struct { + CriUint8 *imageptr; /*EN< Pointer to image data */ + /*JP< 画像データのポインタ */ + CriSint32 frame_id; /*EN< Frame ID */ + /*JP< フレーム識別ID */ + CriUint32 width; /*EN< Width of movie frame [pixel] */ + /*JP< ムービの横幅[pixel] */ + CriUint32 height; /*EN< Height of movie frame [pixel] */ + /*JP< ムービの高さ[pixel] */ + CriUint32 disp_width; /*EN< Width of image [pixel] */ + /*JP< 有効な映像の横幅[pixel] */ + CriUint32 disp_height; /*EN< Height of image [pixel] */ + /*JP< 有効な映像の高さ[pixel] */ + CriUint32 pitch; /*EN< Pitch of movie frame [byte]*/ + /*JP< ムービのピッチ[byte] */ + CriUint64 time; /*EN< Frame time ('time / tunit' indicates time in seconds) */ + /*JP< 時刻。time / tunit で秒を表す。 */ + CriUint64 tunit; /*EN< Unit of time measurement */ + /*JP< 時刻単位 */ + CriSint32 frame_id_per_data; /*EN< Frame ID of the movie data */ + /*JP< ムービデータごとのフレーム番号 */ + CriMvAlphaType alpha_type; /*EN< Composite mode */ + /*JP< アルファの合成モード*/ + void *detail_ptr; /* TEMP: for internal use */ + CriUint32 color_conversion_type; /*EN< Color space converion type. Fullrange or Limited.*/ + /*JP< 色変換タイプ。 */ +} CriMvAlphaFrameInfo; + +// 内部管理用。ムービ情報をユーザに渡す時はこれとほぼ同じだろうか。 +/* Information of USF File */ +typedef struct { + CriBool is_usf_file; + CriUint32 max_chunk_size; + CriUint32 min_buffer_size; + CriUint32 bitrate; + CriUint32 format_version; + /* Video */ + CriUint32 num_video; + CriMvPlyVideoHeader videohead[CRIMV_MAX_VIDEO_NUM]; + /* Audio */ + CriUint32 num_audio; + CriMvPlyAudioHeader audiohead[CRIMV_MAX_AUDIO_NUM]; + /* Subtitle */ + CriUint32 num_subtitle; + CriMvPlySubtitleHeader subtitlehead; + /* Alpha */ + CriUint32 num_alpha; + CriMvPlyAlphaHeader alphahead[CRIMV_MAX_ALPHA_NUM]; + /* CuePoint */ + CriUint32 num_cuepoint; + CriMvPlyCuePointHeader cuepointhead; +} CriMvPlyHeaderInfo; + +/* Video Elementary Stream */ +typedef struct { + CriUint32 fcid; + CriSint32 track_no; // チャンクのチャネル番号 + void *vdec; +} CriMvPlyVideo; + +typedef struct { + CriUint32 fcid; + CriSint32 track_no; // チャンクのチャネル番号 + void *dec; +} CriMvPlyAlpha; + +/* ムービヘッダを管理するための構造体 */ +typedef struct { + CriMvPlyHeaderInfo info; + CriBool write_new_head_flag; // CRIDが見つかって次のヘッダを書き込む準備ができたか? + CriUint32 num_remaining_adec_head; // 必要な残りのオーディオヘッダの数 + CriUint32 num_remaining_vdec_head; // 必要な残りのビデオのヘッダの数 + CriUint32 num_remaining_subtitle_head; // 必要な残りの字幕のヘッダの数 + CriUint32 num_remaining_alpha_head; // 必要な残りのアルファのヘッダ数 + CriUint32 num_remaining_cuepoint_head; // 必要な残りのキューポイントのヘッダ数 + /* 2010-08-19: TEMP: CONCAT_KAI: Don't refer this member. */ + CriUint64 accumulated_tcount; +} CriMvHeaderInfoContainer; + +typedef struct { + CriBool is_play_audio; + CriUint32 fcid; + CriUint32 track_no; // チャンクのチャネル番号 + void *adec; // 実際のオーディオコーデック + CriUint32 num_channel; // データのチャネル数 + CriUint32 sampling_rate; // サンプリング周波数 + CriUint32 output_buffer_samples; + CriSj sji; // UNI + CriSj sjo[CRIMV_PCM_BUFFER_MAX]; // RBF + CriUint32 sjo_bufsize[CRIMV_PCM_BUFFER_MAX]; + CriBool term_supply; // データ供給終了通知フラグ + CriBool is_working; // コンテンツチャンク処理中 + +#if defined(ENABLE_DYNAMIC_AUDIO_SWITCH) + CriUint32 next_track_no; // ユーザが指定した切替先のトラック番号 + CriUint32 last_track_switch_time; // 切替元のトラックの最後にチャンクをとった時刻 + CriUint32 last_track_switch_tunit; // 上記時刻の単位 (in Hz?) + CriMvPlyAmngTrackState switch_state; // トラック切替による状態 +#endif +} *CriMvPlyAdec, CriMvPlyAdecObj; + +typedef struct { + + CriMvPlyAdec mvply_adecs[NUM_MAX_ADEC]; + CriSint32 num_adecs; + CriUint32 size_smpl; + CriSj sji; + CriUint32 chunk_num_per_server; + + CriBool (*cbfunc_nofify_found_header)(void *usrobj, CriChunk *ckc, CriUint8 chno); + void *usrobj_nofify_found_header; + +} *CriMvPlyAmng, CriMvPlyAmngObj; + + +/* シークブロック情報 */ +typedef struct { + CriSint32 top_frame_id; +} CriMvSeekBlockInfo; + +/* ストリーマ用情報 */ +typedef struct { + CriUint32 max_chunk_size; + CriUint32 average_bitrate; +} CriMvStreamerInfo; + + +/* ハンドル作成用コンフィグ構造体 */ +typedef struct { + CriUint32 readbuffer_size; +} CriMvHandleConfig; + + +/*JP CRI Movie ハンドル */ +/*EN + * A handle for a single movie. If multiple movies are to be played simultaneously, + * create a CriMvPly handle for each movie. + * + * \sa criMvPly_Create(), criMvPly_Destroy() */ +typedef struct { + /*** Member variable is ***/ + CriBool used; + CriMvPlyStatus stat; + CriBool request_stop; + CriBool restrain_supply; + CriBool term_supply; + void *cs_work; + void *cshn; + /* USF Header */ + + CriMvHeaderInfoContainer headinfo_container[CRIMVPLY_HEAD_CONTAINER_NUM]; + Uint16 cur_dechead_idx; + CriUint32 cnt_dechead; /* ヘッダ解析ごとに更新 */ + CriUint32 cnt_concat; /* GetFrameで更新 */ + + CriMvPlyHeaderInfo headinfo; + CriUint32 num_headck; /* ヘッダ解析処理したチャンク数 */ + CriFloat32 def_buffering_time; + CriUint32 def_max_stream; + CriUint32 def_sound_output_buffer_samples; + CriSint32 def_track_play_audio; /* -1 でオーディオ再生無し */ + +#if defined(XPT_TGT_XBOX360) || defined(XPT_TGT_PC) || defined(XPT_TGT_VITA) || defined(XPT_TGT_WIIU) + CriSint32 def_num_dlg_threads; + CriUint32 def_processor_mask; + CriUint32 def_affinity_masks[CRIMV_DLGTHREAD_NUM]; + CriSint32 def_thread_priorities[CRIMV_DLGTHREAD_NUM]; +#endif + + CriBool is_prepare_work; + CriMvStreamingParameters stmprm; /* ストリーミングパラメータの記録 */ + /* Demultiplexer */ + CriSint32 inputtype; /* ストリーミングかメモリか?メモリ=ユニSJ再生 */ + CriBool is_usf_data; /* 入力ファイルはUSFファイルか? */ + void *demux; /* USFデマルチプレクサハンドル */ + CriUint32 max_demuxout; /* デマルチプレクサ出力の最大種別数 */ + CriUint32 num_demuxout; /* デマルチプレクサ出力に設定済みの種別数 */ + CriSj headanaly_in_sj; // RBF + CriSj headanaly_out_sj; // UNI + CriSj read_sj; // RBF + CriChunk readck; + + CriSj memplay_sj; // UNI (for memory playback) + CriChunk movie_on_mem; /* メモリ指定のムービデータ記憶用(1個) */ + CriUint32 offset_content; /* メモリ指定先頭データのコンテンツ本体までのサイズ */ + + /* === ハンドル作成時に確保 === */ + CriHeap heap_gen; + /* ヘッダ解析用の読み込み領域 */ + CriUint32 headanaly_bufsize; + /* ハンドル内部メモリは最初に10kbyte確保して使いまわす。具体的にはヘッダ解析用。 */ + CriHeap local_heap; /* ハンドル内部専用Heap */ + CriSint32 local_bufsize; /* ハンドル内部専用Heap用のバッファサイズ */ + CriUint8 *local_bufptr; /* ハンドル内部専用Heap用のバッファポインタ */ + /* === メタワークバッファ (ヘッダ解析時に確保) === */ + CriHeap heap_meta; + /* === ワークバッファ作成時に確保 === */ + CriHeap heap_core; + /* 読み込みバッファ */ + CriUint32 size_readbuf_main; + CriUint32 size_readbuf_ext; + /* Video Decoder */ + CriMvPlyVideo video; + CriUint32 framerate_n; + CriUint32 framerate_d; + /* Audio Decoder */ + CriMvPlyAmng audio_mngr; + CriMvPcmFormat pcmfmt; + CriUint32 size_smpl; + CriHeap heap_audio2; + /* Subtitle */ + CriSj sjo_subtitle; + CriSint32 concat_subtitle_cnt; /* 字幕の連結処理回数 */ + CriSint32 ch_subtitle; /* 字幕の連結処理回数 */ + /* Alpha */ + CriMvPlyAlpha alpha; + + /* 折り返しチャンク対応用(使うかどうかに関係なく変数だけは定義する) */ + CriUint32 bufsize_read_main; /* 入力SJのバッファ本体サイズ */ + CriUint32 bufsize_read_ext; /* 入力SJののりしろサイズ */ + CriUint8 *read_sj_bufptr; /* 入力RBSJの先頭バッファアドレス */ + + /* ストリーミングパラメータに入れるという手段もアリかも? */ + CriSint32 seek_frame_id; /* シークしたいフレームID(GOPの途中の可能性あり) */ + CriSint32 video_gop_top_id; /* シーク後のビデオGOP先頭フレームID : 0以下でシーク無し */ + CriSint32 alpha_gop_top_id; /* シーク後のアルファGOP先頭フレームID : 0以下でシーク無し */ + CriBool seek_video_prep_flag; /* シーク再生のビデオ準備完了フラグ(GOP途中まで進んだか?) */ + CriBool seek_alpha_prep_flag; /* シーク再生のアルファ準備完了フラグ(GOP途中まで進んだか?) */ + CriBool seek_audio_prep_flag; /* シーク再生のオーディオ準備完了フラグ(シーク指定時刻まで捨てたか?) */ + + CriSint32 dechdr_stage; /* DECHDRの進み具合 */ + CriSint32 sji_meta_bufsize; /* メタデータ用入力バッファサイズ */ + CriSj sji_meta; /* メタデータ用入力SJ */ + CriUint32 cnt_meta_ck; /* メタデータ用入力SJ */ + void *video_seektbl_ptr; + CriUint32 video_seektbl_size; + CriSint32 video_gop_num; + void *alpha_seektbl_ptr; + CriUint32 alpha_seektbl_size; + CriSint32 alpha_gop_num; + + void *audio_header_ptr[CRIMV_MAX_AUDIO_NUM]; + CriUint16 audio_header_size[CRIMV_MAX_AUDIO_NUM]; + + void *cuepoint_meta_ptr; + CriUint32 cuepoint_meta_size; + CriMvCuePointInfo cuepoint_info; + + CriMvInputBufferInfo ibuf_info; + CriFloat32 reload_sec_threshold; + + CriSint32 num_frames_for_prep; + + /* For Sofdec2 */ + CriHeap heap_playback; + CriMvMetaDataWorkMallocFunc cbfunc_meta_alloc; + CriMvMetaDataWorkFreeFunc cbfunc_meta_free; + void* usrobj_meta_data; + void* meta_data_work_allocated; /* ユーザアロケータで確保されたメタデータワーク */ + void* event_table_work_allocated; /* ユーザアロケータで確保されたイベントテーブル */ + CriMvStreamerInfo streamer_info; + + /* OUTER_FRAMEPOOL_WORK */ + CriMvFramepoolWorkMallocFunc cbfunc_framepool_alloc; + CriMvFramepoolWorkFreeFunc cbfunc_framepool_free; + void* usrobj_framepool; + void* framepool_work_allocated; /* ユーザアロケータで確保されたフレームプールワーク(解放必要) */ + void* framepool_work_set; /* 直接バッファ指定されたフレームプールワーク(解放不要) */ + + /* For Debug */ + volatile CriUint8 end_sequence_info; + CriUint64Adr header_ptr; + CriSint64 header_size; + CriUint64Adr body_ptr; + CriSint64 body_size; + + CriBool sync_flag; + + CriBool error_flag; + +#if defined(XPT_TGT_IOS) + CriChar8 vavfios_filepath[CRIMVPLY_VAVFIOS_MAX_FILEPATH]; +#endif + + /* For Tools */ + void *extended_mvinfo_config; + + /* ハンドル作成コンフィグ関連 */ + CriBool use_hn_config_flag; /* ハンドル作成コンフィグ指定があったかどうか */ + CriMvHandleConfig hn_config; + +} *CriMvPly, CriMvPlyObj; + +/*************************************************************************** + * Function Declaration + ***************************************************************************/ + +#ifdef __cplusplus +extern "C" { +#endif + +/* ライブラリ初期化 */ +/* + * \brief ライブラリの初期化 + * \param なし + * \return なし + * \par 説明: + * ライブラリの初期化を行います。
+ * 複数回連続で初期化した場合は、最初の1回のみ初期化処理を実行します。 + */ +/* + * \ingroup MODULE_INIT + * \brief Initialize library + * + * This function initializes the CRI Movie library, including internal audio, + * streaming and video subsystems. This function must be + * called before any other function in this library will work properly. + * This function initializes only the first time it is called; if it is + * called again, it simply increments an internal counter and returns; it + * does not re-initialize, nor does it create an error condition. + * + * Therefore, it is safe to call criMvPly_Initialize() and criMvPly_Finalize() + * at the beginning and end, respectively, within each of the independent + * modules in your program. If you match these functions call for call, + * only the first criMvPly_Initialize() function and the last criMvPly_Finalize() + * functions should have any effect. + * + * \sa criMvPly_Finalize() + */ +void CRIAPI criMvPly_Initialize(void); + +/* ライブラリ終了 */ +/* + * \brief ライブラリ終了 + * \param なし + * \return なし + * \par 説明: + * ライブラリの終了処理を行います。
+ * 複数回初期化をしていた場合は、同じ回数だけ終了処理を実行してください。 + */ +/* + * \ingroup MODULE_INIT + * \brief Finalize library + * + * This function deallocates any resources in use by the library. + * It should be called the same number of times that the criMvPly_Initialize() + * function is called. If the criMvPly_Initialize() function is called n + * times, on the nth time the criMvPly_Finalize() function is called, + * criMvPly_Finalize() releases any resources allocated by CRI Movie. + * + * Therefore, it is safe to call criMvPly_Initialize() and criMvPly_Finalize() + * at the beginning and end, respectively, within each of the independent + * modules in your program. If you match these functions call for call, + * only the first criMvPly_Initialize() function and the last criMvPly_Finalize() + * functions should have any effect. + * + * \sa criMvPly_Initialize() + */ +void CRIAPI criMvPly_Finalize(void); + +/* ハンドル作成 */ +/* + * \brief ハンドル作成 + * \param heap : メモリ確保に使用するHeapハンドル + * \return CriMvPlyハンドル + * \par 説明: + * CRI Movie ハンドルを作成します。
+ * 必要なハンドル管理領域はHeapハンドルを使って自動的に確保します。
+ * 作成直後のハンドル状態はSTOP状態です。 + */ +/* + * \ingroup MODULE_INIT + * \brief Create a handle + * \param heap A valid CriHeap handle + * \return A valid CriMvPly handle, or NULL if the handle cannot be allocated + * + * This function creates a CriMvPly handle in the CRIMVPLY_STATUS_STOP state. + * Memory for the handle is allocated from the CriHeap structure that you provide. + * Any memory allocation failure during this function results in a text error message to output, and the program hangs. + * Make sure to initialize and create your heap with criHeap_Initialize() and + * criHeap_Create() before calling this function. + * + * \sa CriMvPly, CriMvPlyStatus, criHeap_Initialize(), criHeap_Create() + */ +CriMvPly CRIAPI criMvPly_Create(CriHeap heap); + +/* コンフィグ指定のハンドル作成 */ +/* config がNULL指定の場合はコンフィグ指定無しと同様 */ +CriMvPly CRIAPI criMvPly_CreateWithConfig(CriHeap heap, CriMvHandleConfig *config); + +/* ハンドル破棄 */ +/* + * \brief ハンドル破棄 + * \param mvply : CRI Movie ハンドル + * \return なし + * \par 説明: + * CRI Movie ハンドルの破棄を行います。
+ * ハンドル作成時に引数で指定したHeapハンドルを使って、ハンドル管理領域を解放します。
+ * ワークバッファを確保したままの場合は、ワークバッファ確保時に指定したHeapハンドルを使ってワークバッファも解放します。
+ * ハンドルの破棄は、ハンドル状態がSTOPかPLAYENDの時にしか実行できません。 + */ +/* + * \ingroup MODULE_INIT + * \brief Destroy a handle + * \param mvply A valid CriMvPly handle to be destroyed + * + * This function destroys the CriMvPly handle previously created + * with criMvPly_Create(). + * + * You can only destroy the handle if it is in either the CRIMVPLY_STATUS_STOP or the + * the CRIMVPLY_STATUS_PLAYEND states. Attempting to destroy the handle in + * any other state will produce an error message. You can check the status of + * the handle at any time with criMvPly_GetStatus(). + * + * Any work buffers allocated via criMvPly_AllocateWorkBuffer(), if they are + * still associated with the handle, are freed when criMvPly_Destroy() is called. + * + * \sa CriMvPly, CriMvPlyStatus, criMvPly_GetStatus(), criMvPly_AllocateWorkBuffer() + */ +void CRIAPI criMvPly_Destroy(CriMvPly mvply); + +/* ストリーミングパラメータの取得 */ +/* + * \brief ストリーミングパラメータの取得 + * \param mvply : CRI Movie ハンドル + * \param stmprm : ストリーミングパラメータ + * \return なし + * \par 説明: + * ヘッダ解析の結果をもとに、ムービ再生に必要なストリーミングパラメータを取得します。
+ * ハンドル状態がWAIT_PREPになると取得できるようになります。
+ * このパラメータをもとにcriMvPly_AllocateWorkBuffer関数を呼び出すことができます。
+ * 必要ならばこのパラメータの値を変更して、例えば音ありムービで音を再生しない、といったことも可能です。
+ */ +/* + * \ingroup MODULE_BUFFER + * \brief Get streaming parameters + * \param mvply A valid CriMvPly handle + * \param stmprm An empty CriMvStreamingParameters structure to be filled with data + * + * This function permits you to get detailed information about the stream and + * dynamically allocate resources just before the video and audio sequence + * begins playback. + * + * This function does nothing if the current state of the CriMvPly handle is + * CRIMVPLY_STATUS_DECHDR or CRIMVPLY_STATUS_STOP. The only useful state in + * which to call criMvPly_GetStreamingParameters() is the CRIMVPLY_WAIT_PREP + * status. When the CriMvPly handle is in the CRIMVPLY_WAIT_PREP status, + * calling this function will cause the CriMvStreamingParameters field to be + * filled with data. + * + * Some of the CriMvStreamingParameters, such as buffering time and the + * maximum number of files to read, are copied from the CriMvPly structure. + * However, maximum bitrate, video size, audio stream rate and channel + * info are calculated from the incoming stream. + * + * After calling criMvPly_GetStreamingParameters(), you can programmatically + * override any of the fields in the CriMvStreamingParameters struct yourself + * before calling criMvPly_AllocateWorkBuffer() with it. For example, you might + * need to read a stream containing both audio and video, but only output the + * video from the stream. In this case you could allocate trivial audio buffers + * for output by modifying the CriMvStreamingParameters struct accordingly after + * calling this function. + * + * \sa criMvPly_AllocateWorkBuffer(), CriMvPly, CriMvStreamingParameters + */ + void CRIAPI criMvPly_GetStreamingParameters(CriMvPly mvply, CriMvStreamingParameters *stmprm); + +/* ワークバッファの確保 */ +/* + * \brief ワークバッファの確保 + * \param mvply : CRI Movie ハンドル + * \param heap : + * \param stmprm : ストリーミングパラメータ + * \return なし + * \par 説明: + * 引数のHeapハンドルを使って、読み込みバッファやビデオ/オーディオのワークバッファを確保します。
+ * この関数を呼び出し可能なのは、STOP状態かWAIT_PREP状態の時のみです。
+ * 同じハンドルに対して2度呼び出すと、1度目のワークバッファを全て解放してから、改めてワークバッファを確保します。
+ * criMvPly_Start関数よりも先にワークバッファを確保しておくこともできます。 + */ +/* + * \ingroup MODULE_BUFFER + * \brief Allocate internal streaming work buffers + * \param mvply A CriMvPly handle + * \param heap A CriHeap handle + * \param stmprm An initialized CriMvStreamingParameters structure + * + * This function allocates internal streaming buffers for the CriMvPly movie + * player from the CriHeap. The amount of memory required is based + * on the maximum bitrate of the stream, the requested buffering time, the + * maximum chunk size, and the height and width of the incoming video frame. + * However, a small amount of memory is allocated for the + * video and audio decoders from the CriHeap as well. + * + * The CriHeap handle passed as a parameter to this function need not + * be the same CriHeap handle you passed to the criMvPly_Create() function. + * You may prefer to use either one or two heaps. + * + * This function can be called only if the CriMvPly handle is in the + * CRIMVPLY_STATUS_STOP or the CRIMVPLY_STATUS_WAIT_PREP status. Calling + * this function any other time will produce an error message. + * + * If this function is called twice without calling criMvPly_FreeWorkBuffer(), + * it releases the previously allocated buffers before allocating them again. + * + * This function must be called sometime before criMvPly_Start(). + * + * \if ps2 + * \par PS2 only: + * The PS2 implementation of this function additionally allocates buffers for + * internal DMA tags. If these allocations fail due to lack of memory, the + * library will hang. + * \endif + * + * \sa CriMvPly, CriHeap, CriMvPlyStatus, CriMvStreamingParameters, criMvPly_FreeWorkBuffer(), + * criMvPly_Start() + */ +CriBool CRIAPI criMvPly_AllocateWorkBuffer(CriMvPly mvply, CriHeap heap, CriMvStreamingParameters *stmprm); + +/* ワークバッファの解放 */ +/* + * \brief ワークバッファの解放 + * \param mvply : CRI Movie ハンドル + * \return なし + * \par 説明: + * criMvPly_AllocateWorkBuffer関数で確保したワークバッファを全て解放します。
+ * この関数を呼び出し可能なのは、STOP/WAIT_PREP/PLAYEND状態の時のみです。
+ * CRI Movie Ver.0.60 では未実装です。 + */ +/* + * \ingroup MODULE_BUFFER + * \brief Release streaming work buffer + * \param mvply A valid CriMvPly handle + * + * This function releases streaming work buffers allocated from the CriHeap + * previously associated with criMvPly_AllocateWorkBuffer(). + * This function should only be called at CRIMVPLY_STATUS_STOP, + * CRIMVPLY_STATUS_WAIT_PREP or CRIMVPLY_STATUS_PLAYEND states. However, this + * function does not verify the current stream status before releasing + * all the buffers; it merely deallocates them. Expect interesting crashes + * if you call this function while playing a movie. + * + * You can verify the current CriMvPly handle status with criMvPly_GetStatus() if + * necessary. + * + */ +void CRIAPI criMvPly_FreeWorkBuffer(CriMvPly mvply); + +/* 再生するオーディオチャネルの設定 */ +/* + * \brief 再生するオーディオチャネルの設定 + * \param mvply : CRI Movie ハンドル + * \param ch : オーディオチャネル番号 + * \return なし + * \par 説明: + * CriMvStreamingParameters構造体のメンバ track_play_audioのデフォルト値を設定します。
+ * criMvPly_GetStreamingParameters関数でCriMvStreamingParameters構造体を取得したときにこの値が格納されます。
+ * 何も設定していない場合、buffering_timeには0が入います。 + * -1を指定するとオーディオを再生しない設定になります。 + */ +void CRIAPI criMvPly_SetAudioTrack(CriMvPly mvply, CriSint32 track); + +/* バッファリング時間(単位[sec])の設定 */ +/* + * \brief バッファリング時間(単位[sec])の設定 + * \param mvply : CRI Movie ハンドル + * \param time : バッファリング時間 + * \return なし + * \par 説明: + * CriMvStreamingParameters構造体のメンバbuffering_timeのデフォルト値を設定します。
+ * criMvPly_GetStreamingParameters関数で CriMvStreamingParameters構造体を取得したときにこの値が格納されます。
+ * 何も設定していない場合、buffering_timeには1.0秒が入っています。 + */ +/* + * \ingroup MODULE_BUFFER + * \brief Set default buffering time (unit[sec]) + * \param mvply A valid CriMvPly handle + * \param time Buffering time in seconds + * + * This function tells the CriMvPly handle how much time of the stream to buffer in + * memory. Buffering is necessary to cover seeks, error retries, latency and + * other various hiccups in most data sources. + * + * This value is stored in the buffering_time field of the CriMvStreamingParameters + * struct. It is set to a default of 1.0 seconds when the CriMvPly handle is created. + * This is typically safe for most DVD type file systems. + * + * \sa CriMvPly, CriMvStreamingParameters + */ +//void CRIAPI criMvPly_SetBufferingTime(CriMvPly mvply, CriFloat32 time); + +/* 同時読み込みファイル数の設定 */ +/* + * \brief 同時読み込みファイル数の設定 + * \param mvply : CRI Movie ハンドル + * \param max_stm : 同時読み込みファイル数 + * \return なし + * \par 説明: + * CriMvStreamingParameters構造体のメンバmax_simultaneous_read_filesのデフォルト値を設定します。
+ * criMvPly_GetStreamingParameters関数で CriMvStreamingParameters構造体を取得したときにこの値が格納されます。
+ * 何も設定していない場合、max_simultaneous_read_filesには1が入っています。 + */ +/* + * \ingroup MODULE_BUFFER + * \brief Set maximum number of simultaneous streams + * \param mvply A valid CriMvPly handle + * \param max_stm The maximum number of simultaneous streams + * + * This function sets the default value of the "max_simultaneous_read_files" field of + * the CriMvStreamingParameters struct. Currently, setting this value has no effect. + */ +//void CRIAPI criMvPly_SetMaxSimultaneousStreams(CriMvPly mvply, CriUint32 max_stm); + +/* サウンド出力バッファサンプル数の設定 */ +/* + * \brief GetWave16で要求する最大サンプル数の設定 + * \param mvply : CRI Movie ハンドル + * \param max_smpl : 最大サンプル数 + * \return なし + * \par 説明: + * CriMvAudioParameters構造体のメンバoutput_buffer_samplesのデフォルト値を設定します。
+ * criMvPly_GetStreamingParameters関数で CriMvStreamingParameters構造体を取得したときにこの値が格納されます。
+ * 何も設定していない場合、output_buffer_samplesには16*1024が入っています。 + */ +/* + * \ingroup MODULE_AUDIO + * \brief Set default sound output buffer samples + * \param mvply A valid CriMvPly handle + * \param smpls : sound output buffer samples + * + * This function sets the default value of the "output_buffer_samples" field in the + * CriMvAudioParameters struct. The default value is 16384, which is set when + * criMvPly_Create() is called. + * + * This function only has an effect if it is called before the + * criMvPly_AllocateWorkBuffer() function is called, since this is when the audio + * output buffer is allocated. + * + * \sa CriMvAudioParameters, criMvPly_Create(), criMvPly_AllocateWorkBuffer(), + * criMvPly_GetWave16() + */ +//void criMvPly_SetMaxSamplesOfGetWave16(CriMvPly mvply, CriUint32 max_smpl); +void CRIAPI criMvPly_SetSoundOutputBufferSamples(CriMvPly mvply, CriUint32 smpls); + +/* ハンドル状態の取得 */ +/* + * \brief ハンドル状態の取得 + * \param mvply : CRI Movie ハンドル + * \return ハンドル状態 + * \par 説明: + * ハンドル状態を取得します。 + */ +/* + * \ingroup MODULE_STATE + * \brief Get the handle status + * \param mvply A valid CriMvPly handle + * \return One of the CriMvPlyStatus enum values + * + * This function gets the current status of the CRI Movie handle. Check the + * following link for possible return values. + * + * \sa CriMvPlyStatus + */ +CriMvPlyStatus CRIAPI criMvPly_GetStatus(CriMvPly mvply); + +/* WAIT状態から次の状態への遷移通知 */ +/* + * \brief WAIT状態から次の状態への遷移通知 + * \param mvply : CRI Movie ハンドル + * \return なし + * \par 説明: + * ハンドル状態をWAIT_**** 状態から次の状態に遷移させます。状態に応じて次のように使用します。
+ * ・WAIT_PREP 状態 : criMvPly_AllocateWorkBuffer関数でワークを確保しおわったら呼び出してください。
+ * ・WAIT_PLAYING 状態 : ビデオフレーム、オーディオデータを取得して表示・出力の準備ができたら、 + * 出力を開始して、本関数を呼び出してください。
+ * ・WAIT_PLAYEND 状態 : 最後のビデオフレームの表示、最後のオーディオデータの出力が終了したら呼び出してください。
+ * ・WAIT_STOP 状態 : ビデオやオーディオの出力が停止してもいい状態になったら、呼び出してください。
+ * 本関数を呼び出すと各状態は即座に次の状態に遷移します。
+ * 本関数を WAIT_**** 以外の状態で呼び出しても、状態は何も変わりません。 + */ +/* + * \ingroup MODULE_STATE + * \brief Notify transition from WAIT status + * \param mvply A valid CriMvPly handle + * + * This function notifies the CriMvPly handle that your application is ready to + * go from the current WAIT state to the next state. There are exactly four states + * in which it is appropriate to call this function: + * + * - CRIMVPLY_STATUS_WAIT_PREP After your application has allocated buffers with + * criMvPly_AllocateWorkBuffer() + * - CRIMVPLY_STATUS_WAIT_PLAYING After your application has prerolled stream data (if + * necessary) + * - CRIMVPLY_STATUS_WAIT_PLAYEND After your application has displayed the last frames of audio and + * video from the stream + * - CRIMVPLY_STATUS_WAIT_STOP After your application suspends playback from the stream + * + * You can check the current status of the CriMvPly handle by calling the criMvPly_GetStatus() + * function. This function has no effect if called in states other than those listed above. + * + * \sa CriMvPly, CriMvPlyStatus + */ +void CRIAPI criMvPly_IncrementState(CriMvPly mvply); + +/* 状態の更新 */ +/* + * \brief CriMvPlyモジュールのサーバ関数 + * \param mvply : CRI Movie ハンドル + * \return なし + * \par 説明: + * 主にデマルチプレクサ内部のデータの更新を行います。
+ * 本関数はアプリケーションのメインスレッド側でで毎回呼び出すようにしてください。
+ */ +void CRIAPI criMvPly_Update(CriMvPly mvply); + +/* 再生開始 */ +/* + * \brief 再生開始 + * \param mvply : CRI Movie ハンドル + * \return 再生開始できた場合はCRI_TRUE, 失敗した場合はCRI_FALSE + * \par 説明: + * 再生のための処理を開始します。
+ * 本関数呼出し後、ハンドル状態はDECHDRに遷移します。
+ */ +/* + * \ingroup MODULE_STATE + * \brief Start of playback processing + * \param mvply A valid CriMvPly handle + * + * This function initiates playback processing. This function should be called + * after the CriMvPly handle is created and the data source has been opened, + * but before the work buffers are allocated with criMvPly_AllocateWorkBuffer(). + * This function sets the current status of the CriMvPly handle to + * CRIMVPLY_STATUS_DECHDR, which prepares it to decode the header information + * from the data source. + * + * \sa CriMvPly, CriMvPlyStatus, criMvPly_AllocateWorkBuffer() + */ +CriBool CRIAPI criMvPly_Start(CriMvPly mvply); + +/* 再生停止リクエスト(即時復帰) */ +/* + * \brief 再生停止リクエスト(即時復帰) + * \param mvply : CRI Movie ハンドル + * \return なし + * \par 説明: + * 再生停止のリクエストを発行して即時復帰します。
+ * 本関数呼出し後、ハンドル状態はSTOP_PROCESSING状態に遷移します。
+ * 停止のための処理が終わると、ハンドル状態がWAIT_STOPに遷移します。
+ * WAIT_STOP状態になったら、criMvPly_IncrementState関数でSTOP状態に遷移させて、 + * アプリケーションの停止処理を行ってください。 + */ +/* + * \ingroup MODULE_STATE + * \brief Non-blocking request to stop playback + * \param mvply A currently playing CriMvPly handle + * + * This function records a request to terminate playback. Termination of + * playback is not synchronous to this function; this function sets the current + * state of the CriMvPly handle to CRIMVPLY_STATUS_STOP_PROCESSING. After + * movie processing is halted, the state of the handle transitions to + * CRIMWPLY_STATUS_WAIT_STOP. + * + * This function is useful for prematurely terminating a movie, e.g. "press + * X to skip this movie". + * + * Video frames will keep being delivered until you detect a CRIMVPLY_STATUS_WAIT_STOP + * state in the CriMvPly handle, and then call criMvPly_IncrementState to transition + * back to the CRIMVPLY_STATUS_STOP state. + * + * \note Pausing is not accomplished through this function. The system clock, including + * whether or not to pause or advance frames, is controlled entirely through user + * code. So the effect of "pausing" a CriMvPly handle can be accomplished by simply + * not updating your system clock as long as your pause is in effect. + * + * \sa CriMvPly, CriMvPlyStatus + */ +void CRIAPI criMvPly_Stop(CriMvPly mvply); + +/* サーバ処理(ハンドル指定) */ +/* + * \brief サーバ処理(ハンドル指定) + * \param mvply : CRI Movie ハンドル + * \return なし + * \par 説明: + * CRI Movie ハンドルを指定してサーバ処理を実行します。
+ * 各WAIT_**** 状態への状態遷移はサーバ関数内で実行されます。 + */ +/* + * \ingroup MODULE_VIDEO + * \brief Execute heartbeat functions for a handle + * \param mvply A valid CriMvPly handle + * + * This function executes heartbeat functions for the specified CriMvPly handle only, + * including handoff and parsing of input buffers and audio decoding. Additionally, + * it checks for buffer situations in which the CriMvPly handle should transition to + * one of the four WAIT states of CriMvPlyStatus, and it makes these transitions if + * necessary. + * + * However, video decoding does NOT occur in criMvPly_Execute(). + * + * Expect that criMvPly_Execute() will take a relatively low CPU load. Typically, + * this function should be called on every vertical blank. However, it may be called + * more frequently in a CriMvPly wait state, in conjunction with criMvPly_IncrementState(), + * in order to "force" a transition into the next state without waiting for + * another vertical blank. This type of transition is not generically + * necessary. + * + * \sa CriMvPly, CriMvPlyStatus, criMvPly_ExecuteAll() + */ +void CRIAPI criMvPly_Execute(CriMvPly mvply); + +/* ファイル読み込みバッファの空きチャンク取得 */ +/* + * \brief ファイル読み込みバッファの空きチャンク取得 + * \param mvply : CRI Movie ハンドル + * \param ck : チャンク + * \return なし + * \par 説明: + * ファイル読み込みバッファの空き領域を取得します。
+ * 取得した空き領域(チャンクと呼びます)は、データ書き込みを通知するさいに + * そのまま使用しますので、アプリケーションで記憶してください。
+ * 1度に取得できるチャンクは1つのみです。
+ * チャンクが取得できたか否かは、チャンクのサイズで判定できます。
+ * データの書き込みが終わったら、criMvPly_PutInputChunk関数で書き込みサイズを通知してください。
+ */ +/* + * \ingroup MODULE_SUPPLY + * \brief Get a free chunk from file reading buffer + * \param mvply A valid CriMvPly handle + * \param ck A CriChunk structure to be filled with data by this function + * + * This function selects an empty internal buffer for your data source to read its data into. + * An area of this type is referred to as a "chunk." + * After calling this function, the ck->data and ck->size + * fields will provide a valid pointer and size, respectively, that your data + * source should copy its data into. + * If no buffers can internally be allocated, this function will return 0 as the + * ck->size field. If this occurs, your program should choke input until a free + * buffer can be allocated. + * Typical data sources are native file reading, sequential memory access, or + * playback from a network source. + * The ck->size field is dynamically calculated when criMvPly_AllocateWorkBuffer() + * is called; it is calculated based on expected data rate and video resolutions + * embedded in the stream file. + * + * After you receive a valid chunk from criMvPly_GetInputChunk(), + * you can fill the provided chunk up to the ck->size limit. After you + * fill the chunk with valid data, call the criMvPly_PutInputChunk() function + * to queue the data for processing. The functions criMvPly_GetInputChunk() and + * criMvPly_PutInputChunk() should be called in equal pairs; calling these + * functions out of order will produce odd results. No dynamic chunk reordering + * is permitted; serial calls with out-of-order chunks will be + * flagged at run-time as an error. + * + * This function will only return a valid chunk if the CriMvPly handle is in + * one of two playback states: CRIMVPLY_STATUS_PLAY or CRIMVPLY_STATUS_DECHDR. + * You can verify the current playback state with criMvPly_GetStatus(). + * + * \sa criMvPly_GetStatus(), criMvPly_PutInputChunk(), criMvPly_AllocateWorkBuffer(), + * CriChunk, CriMvPlyStatus + */ +void CRIAPI criMvPly_GetInputChunk(CriMvPly mvply, CriChunk *ck); + +/* ファイル読み込みバッファへのデータ書き込み通知 */ +/* + * \brief ファイル読み込みバッファへのデータ書き込み通知 + * \param mvply : CRI Movie ハンドル + * \param ck : + * \param inputsize : + * \return なし + * \par 説明: + * criMvPly_GetInputChunk関数で取得した空き領域(チャンクと呼びます)に + * データを書き込み終わったら、引数inputsizeにデータサイズを入れて本関数を呼び出してください。
+ * その際、チャンクは criMvPly_GetInputChunk関数で取得したものと同じチャンクを必ず指定してください。 + */ +/* + * \ingroup MODULE_SUPPLY + * \brief Put a data chunk into file read buffer + * \param mvply A valid CriMvPly handle + * \param ck A CriChunk structure containing source data + * \param inputsize The number of bytes actually supplied + * + * This function informs the CriMvPly handle that the CriChunk structure + * now contains valid data from the data source. Typically, you would call + * this function after your asynchronous file read reports that the buffer is + * full of data. + * + * The inputsize field should contain the number of bytes actually provided. + * This value can be less than or equal to ck->size. In an end-of-file condition, + * be sure to supply the actual number of bytes remaining in the file, and not + * merely the size of the input buffer, to criMvPly_PutInputChunk(). + * Do not modify the contents of the CriChunk after calling this function; + * instead, call criMvPly_GetInputChunk() to get a new chunk for further input. + * + * This function invalidates the CriChunk provided if the function is called + * while the CriMvPly handle is in the CRIMVPLY_STATUS_STOP, the + * CRIMVPLY_STATUS_WAIT_PREP, or the CRIMVPLY_STATUS_STOP_PROCESSING state. + * You can verify the current playback state with criMvPly_GetStatus(). + * + * After you receive a valid chunk from criMvPly_GetInputChunk(), + * you can fill the provided chunk up to the ck->size limit. After you call + * fill the chunk with valid data, call the criMvPly_PutInputChunk() function + * to queue the data for processing. The function criMvPly_GetInputChunk() and + * criMvPly_PutInputChunk() should be called in equal pairs; calling these + * functions out of order will produce odd results. No dynamic chunk reordering + * is permitted; serial calls with out-of-order chunks will be + * flagged at run-time as an error. + * + * After putting the final chunk of data in the stream, call + * criMvPly_TerminateSupply() to indicate that an end-of-file condition exists. + * + * \sa criMvPly_GetStatus(), criMvPly_GetInputChunk(), criMvPly_AllocateWorkBuffer(), + * criMvPly_TerminateSupply(), CriChunk, CriMvPlyStatus + */ +void CRIAPI criMvPly_PutInputChunk(CriMvPly mvply, CriChunk *ck, CriUint32 inputsize); + +/* ファイル読み込み終了の通知 */ +/* + * \brief ファイル読み込み終了の通知 + * \param mvply : CRI Movie ハンドル + * \return なし + * \par 説明: + * 再生したい全てのデータを読み込んで、 criMvPly_PutInputChunk関数で通知し終わったら、 + * 本関数でファイル読み込み終了の通知を必ず行ってください。
+ * 終了を通知された時点で読み込みバッファに書き込まれた全てのデータをデコードし終わると、 + * ハンドル状態はWAIT_PLAYENDに遷移します。
+ * 本関数を呼び出さない限り、WAIT_PLAYEND状態になることはありません。 + */ +/* + * \ingroup MODULE_SUPPLY + * \brief Notify end of reading data + * \param mvply A valid CriMvPly structure + * + * After you put all the source data into the CriMvPly handle with + * criMvPly_PutInputChunk(), indicate the end of the movie file by calling + * criMvPly_TerminateSupply(). After calling this function, the CriMvPly + * handle's status is changed by the library to CRIMVPLY_STATUS_WAIT_PLAYEND + * and the library completes processing of whatever frames it has internally + * buffered. + * + * If you do not call this function, the CriMvPly handle will never transition + * to the CRIMVPLY_STATUS_WAIT_PLAYEND state, making teardown impossible. + * + * \sa criMvPly_PutInputChunk(), CriMvPly, CriMvPlyStatus + */ +void CRIAPI criMvPly_TerminateSupply(CriMvPly mvply); + +#if 0//defined(XPT_TGT_EE) +/* RGB32フォーマットのビデオフレームの取得 */ +/* + * \if ps2 + * \brief RGB32フォーマットのビデオフレームの取得 + * \param mvply : CRI Movie ハンドル + * \param imagebuf : ビデオフレームバッファ + * \param bufsize : バッファサイズ + * \param frameinfo : フレーム情報 + * \return 取得できた場合はTRUE, できなかった場合はFALSE + * \par 説明: + * 引数で指定したバッファに、PS2のマクロブロック並びRGBA32フォーマットでフレームを取得します。
+ * 引数CriMvFrameInfo構造体には、取得したフレームについての情報が格納されます。
+ * フレームが取得できるのは、ハンドル状態がWAIT_PLAYING/PLAYINGの時のみです。
+ * それ以外の状態で呼び出す、または入力データ不足の場合には、本関数はフレームの取得に失敗し、即座に復帰します。
+ * フレームが取得できなかった場合は、関数値でFALSEが返ります。
+ * 実際のビデオデコード処理も本関数内で動くため、フレーム取得できる場合には、処理の重い関数となります。 + * \endif + */ +/* + * \if ps2 + * \ingroup MODULE_VIDEO + * \brief Get a video frame in PS2 macroblock RGB32 format + * \param mvply A valid CriMvPly handle + * \param imagebuf a pointer to the video buffer in memory to receive the frame + * \param bufsize video buffer size in bytes + * \param frameinfo Information about the decoded frame + * \return returns true if a frame has been copied into the buffer, false otherwise + * + * This function finds and decodes the current frame, if any, to the imagebuf buffer. + * The format of this buffer is specific to the PS2. This function will only return + * a valid frame if the CriMvPly handle is in the CRIMVPLY_STATUS_WAIT_PLAYING or the + * CRIMVPLY_STATUS_PLAYING state. + * + * This function is an EE-intensive activity, and the amount of time required + * is variable, depending on the complexity and size of the video frame being decoded. + * Therefore the preferred method of calling this function is in a low priority thread, + * separate from your I/O, buffer management, and criMvPly_Execute() routines. + * + * If this function returns true, the preferred display time of the video frame is calculated + * as: + * + * \code + * frameinfo.time / frameinfo.tunit + * \endcode + * + * Humans notice audio stuttering much more readily than a dropped video frame during + * a video decode process. If the frame reported by criMvPly_GetFrameRGBA32_PS2() + * arrives after your system clock says the frame should be displayed, you should + * simply drop the frame without bothering to DMA it to video memory. + * + * Here is an example showing how to drop frames in this case: + * + * \dontinclude crimvt01_simple_playback_ps2.c + * \skip Get video frame + * \until *tutor_update_video_frame_on_display_time* + * + * It is not preferred, but it is possible, to call this function in a single-threaded + * playback model. In this case, it is important to allocate more heap space + * and service the CriMvPly handle with criMvPly_Execute() or criMvPly_ExecuteAll() + * frequently, as well as criMvPly_GetWave16() frequently. This helps to cover + * for the case where other I/O needs to occur when a frame is currently being decoded by + * criMvPly_GetFrameRGBA32_PS2(). + * + * \image html crimvply_getframergba32_ps2.png The DMA reordering step on PS2 + * + * In order to get acceptable performance on the PS2, a macroblock reordering step + * must take place during the DMA transfer from EE RAM to video RAM. + * \endif + */ +CriBool CRIAPI criMvPly_GetFrameRGBA32_PS2(CriMvPly mvply, CriUint8 *imagebuf, CriUint32 bufsize, CriMvFrameInfo *frameinfo); + +CriBool CRIAPI criMvPly_DecodeFrameRGBA32_PS2(CriMvPly mvply, CriUint8 *imagebuf, CriUint32 bufsize, CriMvFrameInfo *frameinfo); +#endif + +#if defined(XPT_TGT_PC) || defined(XPT_TGT_XBOX360) || defined(XPT_TGT_WII) || defined(XPT_TGT_SH7269) || defined(XPT_TGT_TRGP6K) +/* + * \if pc + * \ingroup MODULE_VIDEO + * \brief Get a video frame in YUV422 format + * \param mvply A valid CriMvPly handle + * \param imagebuf A pointer to the video buffer in memory to receive the frame + * \param pitch Number of bytes in one row of the video buffer + * \param bufsize Video buffer size in bytes + * \param frameinfo Information about the decoded frame + * \return returns true if a frame has been copied into the buffer, false otherwise + * + * This function finds and decodes the current frame, if any, to the imagebuf buffer. + * This function will only return a valid frame if the CriMvPly handle is in the + * CRIMVPLY_STATUS_WAIT_PLAYING or the CRIMVPLY_STATUS_PLAYING state. + * + * This function is a CPU-intensive activity, and the amount of time required + * is variable, depending on the complexity and size of the video frame being decoded. + * Therefore the preferred method of calling this function is in a low priority thread, + * separate from your I/O, buffer management, and criMvPly_Execute() routines. + * + * If this function returns true, the preferred display time of the video frame is calculated + * as: + * + * \code + * frameinfo.time / frameinfo.tunit + * \endcode + * + * It is not preferred, but it is possible, to call this function in a single-threaded + * playback model. In this case, it is important to allocate more heap space + * and service the CriMvPly handle with criMvPly_Execute() or criMvPly_ExecuteAll() + * frequently, as well as criMvPly_GetWave16() frequently. + * + * \endif + */ +CriBool CRIAPI criMvPly_GetFrameYUV422(CriMvPly mvply, CriUint8 *imagebuf, CriUint32 pitch, CriUint32 bufsize, CriMvFrameInfo *frameinfo); +#endif + +/* 16bit WAVEフォーマットのオーディオデータ取得 */ +/* + * \brief 16bit WAVEフォーマットのオーディオデータ取得 + * \param mvply : CRI Movie ハンドル + * \param nch : チャネル数 + * \param waveptr : オーディオデータバッファ + * \param wavesmpl : 要求サンプル数(<バッファサイズ) + * \param waveinfo : 16bit Waveform 情報 + * \return 取得できたサンプル数 + * \par 説明: + * 16bitのWAVEフォーマットでオーディオデータを取得します。引数waveptrには、nch分のバッファポインタを格納した + * 配列を指定してください。
+ * 引数CriMvWaveInfo構造体には、取得したオーディオデータについての情報が格納されます。
+ * 入力データ不足などで要求されたサンプル数のデコードができない場合もあります。
+ * (未実装機能) 本関数の処理が重くなってでも、なるべく要求された多くのオーディオデータを取得するモード。 + */ +/* + * \ingroup MODULE_AUDIO + * \brief Get 16bit wave audio data + * \param mvply A currently playing CriMvPly handle + * \param nch The number of audio channels to get in this call + * \param waveptr An array of audio data buffers to copy audio data into + * \param wavesmpl The number of requested wave data samples (must be less than buffer size) + * \param waveinfo A structure filled by this function with info about this wave + * \return The number of wave data samples actually copied into the buffer + * + * This function copies currently decoding audio data into your output buffer + * for you to send to the audio output. The output format is a sixteen-bit PCM + * format. The data provided is "current", e.g. you should try to minimize latency. + * while delivering the audio data to the output device. + * + * This function will return an empty audio buffer if the input to the CriMvPly + * handle is starving for data, or if criMvPly_Execute() or criMvPly_ExecuteAll() + * has not been called recently. + * + * Note that this function actually copies data. However, the expected bandwidth + * for moving audio data in memory is minimal -- about 176400 bytes per second for + * a stereo stream, which is typically a fraction of 1% of the bandwidth available + * on modern game systems. + * + * For debugging tips on stuttering, see \ref crim_section_stuttering . + */ +CriUint32 CRIAPI criMvPly_GetWave16(CriMvPly mvply, CriUint32 nch, CriSint16 *waveptr[], + CriUint32 wavesmpl, CriMvWaveInfo *waveinfo); +CriUint32 CRIAPI criMvPly_GetWave32(CriMvPly mvply, CriUint32 nch, CriFloat32 *waveptr[], + CriUint32 wavesmpl, CriMvWaveInfo *waveinfo); + + +#if defined(XPT_TGT_EE) +/* スクラッチパッドRAM使用設定 */ +/* スクラッチパッドRAMの使用設定(ハンドル作成前に呼び出すこと) */ +/* + * \brief スクラッチパッドRAM使用設定 + * \param sw : + * \return なし + * \par 説明: + * スクラッチパッドRAMの使用設定を行います。
+ * デフォルトはOFFです。 + */ +/* + * \if ps2 + * \ingroup MODULE_INIT + * \brief Enable or disable PS2 scratch pad (SPRAM) usage + * \param sw : ON to enable scratch pad use, OFF to disable + * + * This function determines whether the video decode step uses the PS2 + * SPRAM memory area for its work. The performance of this library is + * increased by around 30% when using SPRAM; however, this use might + * conflict with graphics engines that depend on exclusive access to SPRAM. + * However, on the PS2, the video decode step occurs synchronously to the + * criMvPly_GetFrameRGBA32_PS2() function, so you can take appropriate external + * locking measures to intelligently synchronize SPRAM utilization. + * The value set by criMvPly_SetUseScratchPadRAM_PS2() is internally checked + * exactly once, during the criMvPly_Create() step; calling this function + * after criMvPly_Create() has no effect. The default setting for this + * function is OFF. + * \endif + */ +void CRIAPI criMvPly_SetUseScratchPadRAM_PS2(CriBool sw); +#endif + + +/* メモリからの再生開始 */ +/* + * \brief メモリからの再生開始 + * \param mvply : CRI Movie ハンドル + * \param memptr : メモリ上のムービデータの先頭アドレス + * \param memsize : メモリ上のムービデータのサイズ + * \return なし + * \par 説明: + * メモリからのムービ再生を開始します。
+ * 本関数の呼び出し前に、あらかじめムービデータの全てをメモリ上に読み込んでおいてください。 + */ +/* + * \ingroup MODULE_STATE + * \brief Start playback from movie file on memory + * \param mvply A currently playing CriMvPly handle + * \param memptr A address of movie file + * \param memsize The size of movie file + * + * Start playback from memory.
+ * Please read movie file to memory before playback. + */ +void CRIAPI criMvPly_StartMemory(CriMvPly mvply, CriUint8* memptr, CriUint32 memsize); + + +/* + * YUV個別バッファへのフレーム取得 + */ +/* + * \if xbox360 + * \ingroup MODULE_VIDEO + * \brief Get a video frame to Y,U,V independently texture buffers + * \param mvply A valid CriMvPly handle + * \param yuvbuffers Information about Y,U,V independently texture buffers + * \param frameinfo Information about the decoded frame + * \return returns true if a frame has been copied into the buffer, false otherwise + * + * This function finds and decodes the current frame, if any, to the Y,U,V texture buffers. + * This function will only return a valid frame if the CriMvPly handle is in the + * CRIMVPLY_STATUS_WAIT_PLAYING or the CRIMVPLY_STATUS_PLAYING state. + * \endif + */ +CriBool CRIAPI criMvPly_GetFrameYUVBuffers(CriMvPly mvply, CriMvYuvBuffers *yuvbuffers, CriMvFrameInfo *frameinfo); + + +/* + * ビデオのデコード + */ +/* + * \ingroup MODULE_VIDEO + * \param mvply The movie player handle + * \return returns the number of decoded frames + * + */ +CriUint32 CRIAPI criMvPly_DecodeVideo(CriMvPly mvply); + +/* + * ヘッダのデコード + */ +/* + * + * \ingroup MODULE_VIDEO + * \param mvply The movie player handle + * + */ +void CRIAPI criMvPly_DecodeHeader(CriMvPly mvply); + +/* + * デコードスキップ指示 + * \par 説明: + * この関数を実行した回数だけ、その後のデコード時に自動的に1枚Bピクチャをスキップする。
+ * スキップ指示を出した次のフレームからは、実際のスキップが実行されていなくても + * 表示時刻はスキップしたものとして補正される。 + */ +/* + * \ingroup MODULE_VIDEO + * \param mvply The movie player handle + * \return returns the number of decoded frames + * + * After calling SkipFrame function, Decoding function skip B-picture. + * To avoid that application judge continuous wrong skip, After calling + * SkipFrame function, next frame time will be adjusted. + */ +void CRIAPI criMvPly_SkipFrame(CriMvPly mvply); + + +#if 0 +/* + * YUVA8フォーマットのフレーム取得 + */ +/* + * \if ps3 + * \ingroup MODULE_VIDEO + * \brief Get a video frame in YUVA8 format. + * \param mvply A valid CriMvPly handle + * \param imagebuf A pointer to the video buffer in memory to receive the frame + * \param pitch Number of bytes in one row of the video buffer + * \param bufsize Video buffer size in bytes + * \param frameinfo Information about the decoded frame + * \return returns true if a frame has been copied into the buffer, false otherwise + * + * This function finds and decodes the current frame, if any, to the imagebuf buffer. + * This function will only return a valid frame if the CriMvPly handle is in the + * CRIMVPLY_STATUS_WAIT_PLAYING or the CRIMVPLY_STATUS_PLAYING state. + * \endif + */ +CriBool CRIAPI criMvPly_GetFrameYUVA8_PS3(CriMvPly mvply, CriUint8 *imagebuf, CriUint32 pitch, CriUint32 bufsize, CriMvFrameInfo *frameinfo); +#endif + +/* + * ARGB8888フォーマットでフレーム取得 + */ +/* + * \if ps3 + * \ingroup MODULE_VIDEO + * \brief Get a video frame in ARGB8888 format. + * \param mvply A valid CriMvPly handle + * \param imagebuf A pointer to the video buffer in memory to receive the frame + * \param pitch Number of bytes in one row of the video buffer + * \param bufsize Video buffer size in bytes + * \param frameinfo Information about the decoded frame + * \return returns true if a frame has been copied into the buffer, false otherwise + * + * This function finds and decodes the current frame, if any, to the imagebuf buffer. + * This function will only return a valid frame if the CriMvPly handle is in the + * CRIMVPLY_STATUS_WAIT_PLAYING or the CRIMVPLY_STATUS_PLAYING state. + * \endif + */ +CriBool CRIAPI criMvPly_GetFrameARGB8888(CriMvPly mvply, CriUint8 *imagebuf, CriUint32 pitch, CriUint32 bufsize, CriMvFrameInfo *frameinfo); +void CRIAPI criMvPly_InitializeFrameARGB8888(void); + + +#if defined(XPT_TGT_IPHONE) || defined(XPT_TGT_WINMO) || defined(XPT_TGT_ANDROID) || defined(XPT_TGT_CQSH2A) || defined(XPT_TGT_ACRODEA) || defined(XPT_TGT_NACL) || defined(XPT_TGT_SH7269) || defined(XPT_TGT_TRGP6K) +/* + * RGB565フォーマットでフレーム取得 + */ +/* + * \ingroup MODULE_VIDEO + * \brief Get a video frame in RGB565 format + */ +CriBool CRIAPI criMvPly_GetFrameRGB565(CriMvPly mvply, CriUint8 *imagebuf, CriUint32 pitch, CriUint32 bufsize, CriMvFrameInfo *frameinfo); +void CRIAPI criMvPly_InitializeFrameRGB565(void); +#endif + +/* + * 次のフレームの情報だけ取得する + */ +/* + * \ingroup MODULE_VIDEO + * \brief Get a information of next video frame (without actual video frame). + */ +CriUint8* CRIAPI criMvPly_GetNextFrameInfo(CriMvPly mvply, CriMvFrameInfo *frameinfo); + +/* + * 次のフレームを捨てる + */ +CriBool CRIAPI criMvPly_DiscardNextFrame(CriMvPly mvply, CriMvFrameInfo *frameinfo); + +/* + * 再生準備完了状態(PREPからWAIT_PLAYING)になるまでに貯金するフレーム数の指定 + * この関数を呼び出さなければ、貯金フレーム数 = フレームプール数 + */ +void CRIAPI criMvPly_SetNumberOfFramesForPrep(CriMvPly mvply, CriSint32 nframes); + +/* + * For Debug use. + */ +void CRIAPI criMvPly_SetSeekPosition(CriMvPly mvply, CriSint32 seek_frame_id, CriSint32 video_gop_top_id); +void CRIAPI criMvPly_SetSeekAlphaPosition(CriMvPly mvply, CriSint32 alpha_gop_top_id); +void CRIAPI criMvPly_CalcSeekPosition(CriMvPly mvply, void *seektbl_ptr, CriUint32 seektbl_size, Sint32 frame_id, Uint64 *offset, Sint32 *gop_top_id); + +/* for specific use */ +/* ボディアドレスの設定 */ +void CRIAPI criMvPly_SetBodyData(CriMvPly mvply, const CriUint64Adr body_ptr, CriSint64 body_size); + +/* 入力SJおよびバッファサイズの取得(バッファサイズ、リロードサイズはNULL指定で省略) */ +CriSj CRIAPI criMvPly_GetInputSj(CriMvPly mvply, CriUint32 *buffer_size, CriUint32 *reload_threshold); + +/* 名前&タイプ指定によるイベントポイント情報の取得 */ +//Bool criMvPly_SearchEventPointByName(CriMvPly mvply, Char8 *cue_name, Sint32 type, CriMvEventPoint *eventinfo); +/* イベントポイント情報からフレームIDへの変換 */ +//Sint32 criMvPly_CalcFrameIdFromCuePoint(CriMvPly mvply, CriMvEventPoint *eventinfo); + +CriBool CRIAPI criMvPly_AttachSubAudio(CriMvPly mvply, CriHeap heap, CriUint32 track); +CriUint32 CRIAPI criMvPly_GetSubAudioWave16(CriMvPly mvply, CriUint32 nch, CriSint16 *waveptr[], CriUint32 wavesmpl, CriMvWaveInfo *waveinfo); +CriUint32 CRIAPI criMvPly_GetSubAudioWave32(CriMvPly mvply, CriUint32 nch, CriFloat32 *waveptr[], CriUint32 wavesmpl, CriMvWaveInfo *waveinfo); +void CRIAPI criMvPly_DetachSubAudio(CriMvPly mvply); + +void CRIAPI criMvPly_GetSubtitle(CriMvPly mvply, CriUint8 *bufptr, CriUint32 bufsize, CriMvSubtitleInfo *info); +void CRIAPI criMvPly_GetNextSubtitleInfo(CriMvPly mvply, CriMvSubtitleInfo *info); + +/* 入力バッファのデータ量を見る[byte] */ +CriUint32 CRIAPI criMvPly_PeekInputBufferData(CriMvPly mvply); +/* メモリ上のムービを入力SJに追加する */ +void CRIAPI criMvPly_AddInputMemory(CriMvPly mvply, CriUint8* memptr, CriUint32 memsize); + + +/* 取得できるオーディオデータのサンプル数を調べる */ +CriUint32 CRIAPI criMvPly_GetDataSizeMainAudio(CriMvPly mvply, CriUint32 nch); +/* 取得できるオーディオデータのサンプル数を調べる */ +CriUint32 CRIAPI criMvPly_GetDataSizeSubAudio(CriMvPly mvply, CriUint32 nch); + +/* メインのオーディオの再生が終了しているかどうかを調べる */ +CriBool CRIAPI criMvPly_IsEndMainAudioPlayback(CriMvPly mvply); +/* サブのオーディオの再生が終了しているかどうかを調べる */ +CriBool CRIAPI criMvPly_IsEndSubAudioPlayback(CriMvPly mvply); + +/* メインオーディオが活動中かどうかを調べる (デコード中かつ出力バッファがある状態) */ +CriBool CRIAPI criMvPly_IsActiveMainAudioPlayback(CriMvPly mvply); + +/* ワーク確保前に設定変更すること */ +void CRIAPI criMvPly_SetPcmFormat(CriMvPly mvply, CriMvPcmFormat pcmfmt); + +#if defined(XPT_TGT_PC) +/* [PC] マルチプロセッサの指定 */ +void CRIAPI criMvPly_SetProcessorParameters_PC(CriMvPly mvply, Sint32 thread_num, Uint32 *affinity_masks, Sint32 *priorities); +#endif + +#if defined(XPT_TGT_WIIU) +/* */ +void criMvPly_SetMultiCoreDecode_WIIU(CriBool sw); +#endif + +#if defined(XPT_TGT_XBOX360) +/* [Xbox360] マルチプロセッサの指定 */ +void CRIAPI criMvPly_SetProcessorParameters_XBOX360(CriMvPly mvply, Sint32 thread_num, CriUint32 processor_mask, CriSint32 *priorities); +#endif + +#if defined(XPT_TGT_PS3PPU) +/* [PS3] SPURSの指定 */ +void CRIAPI criMvPly_SetupSpursParameters_PS3(CriMvProcessorParameters_PS3 *processor_param); + /* [PS3] SPUスレッドによるマルチプロセッサの指定 */ +void CRIAPI criMvPly_SetupSpuThreadParameters_PS3(CriMvSpuThreadParameters_PS3 *spu_thread_param); +#endif + +#if defined(XPT_TGT_PS3PPU) +void CRIAPI criMvPly_SetGraphicEnv(CriMvGraphicEnv env); +CriMvGraphicEnv CRIAPI criMvPly_GetGraphicEnv(void); +#endif + +/* フレームプール情報の取得 */ +void CRIAPI criMvPly_GetFramePoolInfo(CriMvPly mvply, CriSint32 *num_input, CriUint32* num_data, CriUint32* num_ref, CriUint32* num_hold, CriUint32* num_free); + +/* 再生中でも字幕チャネルを切り替える */ +void CRIAPI criMvPly_SetSubtitleChannel(CriMvPly mvply, CriSint32 chno); + +/* ポインタだけ取得してフレームプール内のバッファをロックする */ +CriBool CRIAPI criMvPly_LockFrameBuffer(CriMvPly mvply, CriMvYuvBuffers *yuvbuffers, CriMvFrameInfo *frameinfo); +/* ロックしていたフレームプールを解放する */ +CriBool CRIAPI criMvPly_UnlockFrameBuffer(CriMvPly mvply, CriMvFrameInfo *frameinfo); + +/* + * For Sofdec2 + */ +CriMvPly CRIAPI criMvPly_CreateWithWork(void *work, CriSint32 size, CriMvHandleConfig *config); +CriSint32 CRIAPI criMvPly_CalcHandleWorkSize(CriMvHandleConfig *config); +CriSint32 CRIAPI criMvPly_CalcPlaybackWorkSize(CriMvPly mvply, CriMvStreamingParameters *stmprm); +CriBool CRIAPI criMvPly_AllocateWorkBufferWithWork(CriMvPly mvply, void *work ,Sint32 work_size, CriMvStreamingParameters *stmprm); +void CRIAPI criMvPly_SetMetaDataWorkAllocator(CriMvPly mvply, CriMvMetaDataWorkMallocFunc allocfunc, CriMvMetaDataWorkFreeFunc freefunc, void *usrobj, CriMvMetaFlag meta_flag); +CriSint32 criMvPly_CalcSubAudioWorkSize(CriMvPly mvply, const CriMvAudioParameters *aprm); +CriBool criMvPly_CopyFrameYUVBuffers(CriMvPly mvply, CriMvYuvBuffers *yuvbuffers, + const CriMvFrameInfo *frameinfo,const CriMvAlphaFrameInfo *alpha_frameinfo); +CriBool criMvPly_CopyFrameARGB8888Buffer(CriMvPly mvply, CriUint8 *dst_buf, CriUint32 dst_pitch, CriUint32 dst_bufsize, + const CriMvYuvBuffers *src_bufs, const CriMvFrameInfo *src_vinf, const CriMvAlphaFrameInfo *src_ainf); +#if defined(XPT_TGT_IPHONE) || defined(XPT_TGT_WINMO) || defined(XPT_TGT_ANDROID) || defined(XPT_TGT_CQSH2A) || defined(XPT_TGT_ACRODEA) || defined(XPT_TGT_NACL) || defined(XPT_TGT_SH7269) || defined(XPT_TGT_TRGP6K) || defined(XPT_TGT_TRGP6K) +CriBool criMvPly_CopyFrameRGB565Buffer(CriMvPly mvply, CriUint8 *dst_buf, CriUint32 dst_pitch, CriUint32 dst_bufsize, + const CriMvYuvBuffers *src_bufs, const CriMvFrameInfo *src_vinf, const CriMvAlphaFrameInfo *src_ainf); +#endif +CriBool criMvPly_LockAlphaFrameBuffer(CriMvPly mvply, CriMvYuvBuffers *yuvbuffers, CriMvAlphaFrameInfo *alpha_frameinfo); +CriBool criMvPly_UnlockAlphaFrameBuffer(CriMvPly mvply, CriMvAlphaFrameInfo *alpha_frameinfo); +CriSint32 criMvPly_GetNumPictureData(CriMvPly mvply); +const CriMvPlyHeaderInfo* criMvPly_GetCurrentStreamInfo(CriMvPly mvply); +/* for debug */ +CriBool CRIAPI criMvPly_GetAlphaFrame(CriMvPly mvply, CriUint8 *imagebuf, CriUint32 pitch, CriMvAlphaFrameInfo *alpha_frameinfo); + +/* OUTER_FRAMEPOOL_WORK */ +/* フレームプール用ワーク計算。ハンドルはNULL指定OK。 */ +CriSint32 criMvPly_CalcFramepoolWorkSize(CriMvPly mvply, const CriMvStreamingParameters *stmprm); +/* フレームプール用ワーク設定 */ +void criMvPly_SetFramepoolWork(CriMvPly mvply, void *work, CriSint32 work_size); +/* フレームプール用ワークアロケータ設定 */ +void criMvPly_SetFramepoolWorkAllocator(CriMvPly mvply, CriMvFramepoolWorkMallocFunc allocfunc, CriMvFramepoolWorkFreeFunc freefunc, void *usrobj); + +/* シークブロック情報の取得 */ +/* <入力> + * - seektbl_ptr : UTFアドレス + * - seektbl_size : UTFサイズ + * - num_seekblock : 出力配列の要素数 + * <出力> + * - blockinfo : シークブロック情報配列へのポインタ(num_seekblock分の領域を確保して渡すこと) + */ +void criMvPly_GetSeekBlockInfo(CriMvPly mvply, void *seektbl_ptr, CriUint32 seektbl_size, CriSint32 num_seekblock, CriMvSeekBlockInfo *blockinfo); + +/* フレームレートの強制指定 */ +void criMvPly_SetVideoFramerate(CriMvPly mvply, CriUint32 framerate_n, CriUint32 framerate_d); + +/* 同期有無の設定 */ +void criMvPly_SetSyncFlag(CriMvPly mvply, CriBool sync_flag); + +/* 再生可能かの問い合わせ */ +CriBool criMvPly_IsPlayable(CriMvPly mvply, const CriMvStreamingParameters *stmprm); + +#ifdef __cplusplus +} +#endif + +#endif /* CRI_MOVIE_CORE_H_INCLUDED */ diff --git a/3rdParty/cri/Durango/include/cri_sj.h b/3rdParty/cri/Durango/include/cri_sj.h new file mode 100644 index 00000000..28b29424 --- /dev/null +++ b/3rdParty/cri/Durango/include/cri_sj.h @@ -0,0 +1,189 @@ +/**************************************************************************** + * + * CRI Middleware SDK + * + * Copyright (c) 2006-2010 CRI Middleware Co., Ltd. + * + ****************************************************************************/ + +#ifndef _CRI_SJ_H_INCLUDED +#define _CRI_SJ_H_INCLUDED +/**************************************************************************** + * * + * CRI Stream Joint "CriSj" Library * + * * + * 2005-06-21 written by M.Oshimi * + * * + ****************************************************************************/ + +/**************************************************************************** + * Include file * + ****************************************************************************/ +#include "cri_xpt.h" +#include "cri_heap.h" + +/**************************************************************************** + * MACRO CONSTANT * + ****************************************************************************/ + +/* Version number of CriSj */ +#define CRISJ_NAME_STRINGS "CRI Stream Joint" +#define CRISJ_VERSION_STRINGS "1.01.00" + +#define CRISJUNI_MAX_LINE (4) +#define CRICHUNK_MAX_SIZE (0xffffffff) + +/*********************************************************************** + * Process MACRO + ***********************************************************************/ + +/**************************************************************************** + * Data type declaration * + ****************************************************************************/ + +/* ストリームライン */ +typedef enum { + CRISJ_LINE_FREE = (0), + CRISJ_LINE_DATA = (1), + CRISJ_LINE_HOLD = (2), + CRISJ_LINE_EXTRA = (3), + /* enum be 4bytes */ + CRISJ_LINE_ENUM_BE_SINT32 = 0x7FFFFFFF +} CriSjLine; + +/* チャンク */ +#ifndef TYPEDEF_CRICHUNK +#define TYPEDEF_CRICHUNK +typedef struct { + CriUint8 *data; /* データ */ + CriUint32 size; /* バイト数 */ +} CriChunk; +#endif + +/* CriSjハンドル */ +/* CriSj handle */ +typedef struct { + struct _crisj_function_table *vtbl; + const CriChar8 *name; +} CriSjObj, *CriSj; + +typedef struct _crisj_function_table { + /* ハンドルの消去 */ + void (*Destroy)(CriSj sj); + /* リセット */ + void (*Reset)(CriSj sj); + /* チャンクの取得 (FIFOの先頭から取得) */ + void (*GetChunk)(CriSj sj, CriSjLine id, CriUint32 nbyte, CriChunk *ck); + /* チャンクを戻す (FIFOの先頭に挿入) */ + void (*UngetChunk)(CriSj sj, CriSjLine id, CriChunk *ck); + /* チャンクを挿入 (FIFOの最後に挿入) */ + void (*PutChunk)(CriSj sj, CriSjLine id, CriChunk *ck); + /* ラインから取得できる総バイト数の取得 */ + CriUint32 (*GetTotalSize)(CriSj sj, CriSjLine id); +} CriSjVirtualFunctionTable; + +typedef enum { + CRISJ_UNIMODE_SEPARATE = (0), + CRISJ_UNIMODE_JOIN = (1), + /* enum be 4bytes */ + CRISJ_UNIMODE_ENUM_BE_SINT32 = 0x7FFFFFFF +} CriSjUniversalMode; + + +typedef struct CriSjRbfConfig { + CriBool use_cs; + CriUint32 buffer_size; + CriUint32 extra_size; + CriUint32 alignment; + const CriChar8 *buffer_name; +} CriSjRbfConfig; + +typedef struct CriSjMemConfig { + CriBool use_cs; + CriUint8 *data; + CriUint32 data_size; +} CriSjMemConfig; + +typedef struct CriSjUniConfig { + CriBool use_cs; + CriSjUniversalMode mode; + CriUint32 num_chunks; +} CriSjUniConfig; + +/**************************************************************************** + * Function Declaration * + ****************************************************************************/ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +/* リングバッファ型SJの作成 */ +CriSint32 CRIAPI criSjRbf_CalculateWorkSize(const CriSjRbfConfig* config); +CriSj CRIAPI criSjRbf_Create(const CriSjRbfConfig *config, void *work, CriSint32 work_size); +CriSj CRIAPI criSjRbf_CreateByHeap(const CriSjRbfConfig *config, CriHeap heap, CriHeapType heap_type); + +/* 常駐メモリ型SJの作成 */ +CriSint32 CRIAPI criSjMem_CalculateWorkSize(const CriSjMemConfig* config); +CriSj CRIAPI criSjMem_Create(const CriSjMemConfig *config, void *work, CriSint32 work_size); +CriSj CRIAPI criSjMem_CreateByHeap(const CriSjMemConfig *config, CriHeap heap, CriHeapType heap_type); + +/* ユニバーサルSJの作成 */ +CriSint32 CRIAPI criSjUni_CalculateWorkSize(const CriSjUniConfig* config); +CriSj CRIAPI criSjUni_Create(const CriSjUniConfig *config, void *work, CriSint32 work_size); +CriSj CRIAPI criSjUni_CreateByHeap(const CriSjUniConfig *config, CriHeap heap, CriHeapType heap_type); +/* チェインプール数の取得 */ +CriSint32 CRIAPI criSjUni_GetNumChainPool(CriSj sj); + +void CRIAPI criSj_Destroy(CriSj sj); +void CRIAPI criSj_Reset(CriSj sj); +void CRIAPI criSj_GetChunk(CriSj sj, CriSjLine line, CriUint32 nbyte, CriChunk *ck); +void CRIAPI criSj_UngetChunk(CriSj sj, CriSjLine line, CriChunk *ck); +void CRIAPI criSj_PutChunk(CriSj sj, CriSjLine line, CriChunk *ck); +CriUint32 CRIAPI criSj_GetTotalSize(CriSj sj, CriSjLine line); +void CRIAPI criSj_SplitChunk(CriChunk *ck, CriUint32 nbyte, CriChunk *ck1, CriChunk *ck2); + +/*** +* New APIs +***/ + +CriUint32 CRIAPI criSj_GetInputFreeSize(CriSj sj); +void CRIAPI criSj_GetInputChunk(CriSj sj, CriChunk *ck); +void CRIAPI criSj_PutInputChunk(CriSj sj, CriChunk *ck, CriUint32 input_size); +CriUint32 CRIAPI criSj_GetOutputDataSize(CriSj sj); +void CRIAPI criSj_GetOutputChunk(CriSj sj, CriChunk *ck); +void CRIAPI criSj_PutOutputChunk(CriSj sj, CriChunk *ck, CriUint32 output_size); + +CriUint32 CRIAPI criSj_PutOutputChunk2(CriSj sj, CriChunk *ck1, CriChunk *ck2, CriUint32 output_size); + + +/*** +* Old Interface (for compatibility) +***/ +typedef struct _CriSjConfig { + CriBool use_cs; + CriHeapType heap_type; +} CriSjConfig; + +CriSj CRIAPI criSj_CreateRingBuffer(CriHeap heap, CriUint32 bsize, CriUint32 xsize, CriUint32 align); +CriSj CRIAPI criSj_CreateNamedRingBuffer(CriHeap heap, CriUint32 bsize, CriUint32 xsize, CriUint32 align, const CriChar8 *bname); +CriSj CRIAPI criSj_CreateRingBufferWithConfig(CriHeap heap, CriUint32 bsize, CriUint32 xsize, CriUint32 align, const CriSjConfig *config); +CriSj CRIAPI criSj_CreateNamedRingBufferWithConfig(CriHeap heap, CriUint32 bsize, CriUint32 xsize, CriUint32 align, const CriChar8 *bname, const CriSjConfig *config); +CriSint32 CRIAPI criSjRbf_GetRequiredMemorySizeWithConfig(CriUint32 bsize, CriUint32 xsize, CriUint32 align, const CriSjConfig *config); + +CriSj CRIAPI criSj_CreateMemory(CriHeap heap, CriUint8 *data, CriUint32 dtsize, CriUint32 align); +CriSj CRIAPI criSj_CreateMemoryWithConfig(CriHeap heap, CriUint8 *data, CriUint32 dtsize, CriUint32 align, const CriSjConfig *config); +CriSint32 CRIAPI criSjMem_GetRequiredMemorySizeWithConfig(CriUint32 align, const CriSjConfig *config); + +CriSj CRIAPI criSj_CreateUniversal(CriHeap heap, CriSjUniversalMode mode, CriUint32 nchunk); +CriSj CRIAPI criSj_CreateUniversalWithConfig(CriHeap heap, CriSjUniversalMode mode, CriUint32 nchunk, const CriSjConfig *config); +CriSint32 CRIAPI criSjUni_GetRequiredMemorySizeWithConfig(CriSjUniversalMode mode, CriUint32 nchunk, const CriSjConfig *config); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + + +#endif + +/* end of file */ diff --git a/3rdParty/cri/Durango/include/cri_xpt.h b/3rdParty/cri/Durango/include/cri_xpt.h new file mode 100644 index 00000000..56d5759b --- /dev/null +++ b/3rdParty/cri/Durango/include/cri_xpt.h @@ -0,0 +1,26 @@ +/**************************************************************************** + * + * CRI Middleware SDK + * + * Copyright (c) 2004-2009 CRI Middleware Co., Ltd. + * + * Library : CRI Middleware Library + * Module : CRI Common Header for XboxOne + * File : cri_xpt.h + * Date : 2013-03-04 + * Version : 1.16 + * + ****************************************************************************/ +#ifndef CRI_INCL_CRI_XPT_H +#define CRI_INCL_CRI_XPT_H + +#define XPT_TGT_XBOXONE +#define XPT_CCS_LEND +#define XPT_SUPPORT_MULTICHANNEL +#define CRI_TARGET_STR "XboxOne" + +#include "cri_xpts_durango.h" +#include "cri_xpt_post.h" + +#endif /* CRI_INCL_CRI_XPT_H */ +/* End Of File */ diff --git a/3rdParty/cri/Durango/include/cri_xpt_post.h b/3rdParty/cri/Durango/include/cri_xpt_post.h new file mode 100644 index 00000000..de333b7b --- /dev/null +++ b/3rdParty/cri/Durango/include/cri_xpt_post.h @@ -0,0 +1,256 @@ +/***************************************************************************** + * + * CRI Middleware SDK + * + * Copyright (c) 1998-2012 CRI Middleware Co., Ltd. + * + * Library : CRI Middleware Library + * Module : CRI Common Header / Post-Process + * File : cri_xpt_post.h + * Date : 2012-05-15 + * Version : 2.07 + * + *****************************************************************************/ +#ifndef CRI_INCL_CRI_XPT_POST_H +#define CRI_INCL_CRI_XPT_POST_H + + +/***************************************************************************** + * }N` + * Macro definition + *****************************************************************************/ + +/* RpC̐ÓIAT[g + * C++ BoostSTATIC_ASSERTƓ̋@\CŎB + * ^ł邱Ƃ؂BȔꍇ̓RpCG[NāAR + * pC~B + * Static Asart when compiling + * This function is equal to STATIC_ASSERT of C++ Boost, and is imprementated + * by C language. If the condition is false, a compiler error is caused and + * it stop compiling. + */ +#define XPT_STATIC_ASSERT(cond) extern int xpt_static_assert_array[(cond)?1:-1] + + +/***************************************************************************** + * RpCIvV̌ + * Compiler option test + *****************************************************************************/ + +/* enum^̌ + * @enum^int^ɐ邱Ƃ؂B + * @K؂ȃG[bZ[W\̂ŁA”\ȂRpCIvVɂ + * @`FbNsBs”\ȏꍇAėpIȐÓIAT[gɂ`FbNB + * Enum type test + * It is verified that the enum type adjusts to the int type. + * To display an appropriate error message, it checks the compiler option + * if possible. General static asart test works if it is impossible. + */ +#if defined(__MWERKS__) /* CodeWarrior */ + //#if !__option(enumsalwaysint) + // #error ERROR cri_xpt_post.h : Compiler option 'Enums Always Int' should be ON. + //#endif +#elif defined(__GNUC__) + //#if Compiler option -fshort-enums is used + // #error ERROR cri_xpt_post.h : Compiler option '-fshort-enums' should not be used. + //#endif +#endif +//typedef enum {XPT_TEST_ENUM_0, XPT_TEST_ENUM_1, XPT_TEST_ENUM_2} XptTestEnum; +//XPT_STATIC_ASSERT(sizeof(XptTestEnum) == sizeof(Uint32)); /* enum should be 4byte. */ + +/***************************************************************************** + * 萔}N + * Macros of constant value + *****************************************************************************/ + +/* NULL |C^^ */ +#if !defined(CRI_NULL) +#ifdef __cplusplus +#define CRI_NULL (0) +#else +#define CRI_NULL ((void *)0) +#endif +#endif + +/* _萔PiUA^j */ +#if !defined(CRI_FALSE) +#define CRI_FALSE (0) +#endif +#if !defined(CRI_TRUE) +#define CRI_TRUE (1) +#endif + +/* _萔QiXCb`j */ +#if !defined(CRI_OFF) +#define CRI_OFF (0) +#endif +#if !defined(CRI_ON) +#define CRI_ON (1) +#endif + +/* ʔ̒萔iAsj */ +#if !defined(CRI_OK) +#define CRI_OK (0) /* */ +#endif +#if !defined(CRI_NG) +#define CRI_NG (-1) /* s */ +#endif + +/***************************************************************************** + * |C^܂64rbgAhXi[ł鐮^ + * l: |C^32bitROMAhX64bit̊‹ŁA҂𓧉ߓIɈB + * The integer type which can hold an pointer or an address up to 64 bits. + * NOTE: In the environment of pointer 32bit and ROM address space 64bit, + * this type can treat both transparently. + *****************************************************************************/ + +#if !defined(_TYPEDEF_CriUint64Adr) +#define _TYPEDEF_CriUint64Adr +typedef CriUint64 CriUint64Adr; /* |C^܂64rbgAhXi[ł鐮^ */ +#endif + +#if !defined(CRI_PTR_TO_UINT64ADR) +#define CRI_PTR_TO_UINT64ADR(ptr) ((CriUint64Adr)(ptr)) /* Convert pointer to CriUint64Adr */ +#endif + +#if !defined(CRI_UINT64ADR_TO_PTR) +#define CRI_UINT64ADR_TO_PTR(uint64adr) ((void *)(CriUintPtr)(uint64adr)) /* Convert CriUint64Adr to pointer */ +#endif + +#if !defined(CRI_XPT_DISABLE_UNPREFIXED_TYPE) + +/***************************************************************************** + * ݊ێ̂߂̒萔}N + * Macros for compatibility with old version + *****************************************************************************/ + +/* NULL |C^^ */ +#if !defined(NULL) +#define NULL (CRI_NULL) +#endif + +/* _萔PiUA^j */ +#if !defined(FALSE) +#define FALSE (CRI_FALSE) +#endif +#if !defined(TRUE) +#define TRUE (CRI_TRUE) +#endif + +/* _萔QiXCb`j */ +#if !defined(OFF) +#define OFF (CRI_OFF) +#endif +#if !defined(ON) +#define ON (CRI_ON) +#endif + +/* ʔ̒萔iAsj */ +#if !defined(OK) +#define OK (CRI_OK) +#endif +#if !defined(NG) +#define NG (CRI_NG) +#endif + +/***************************************************************************** + * ݊ێ̂߂̃f[^^錾 + * Types for compatibility with old version + *****************************************************************************/ + +#if !defined(_TYPEDEF_Uint8) +#define _TYPEDEF_Uint8 +typedef CriUint8 Uint8; /* ȂPoCg */ +#endif + +#if !defined(_TYPEDEF_Sint8) +#define _TYPEDEF_Sint8 +typedef CriSint8 Sint8; /* ‚PoCg */ +#endif + +#if !defined(_TYPEDEF_Uint16) +#define _TYPEDEF_Uint16 +typedef CriUint16 Uint16; /* ȂQoCg */ +#endif + +#if !defined(_TYPEDEF_Sint16) +#define _TYPEDEF_Sint16 +typedef CriSint16 Sint16; /* ‚QoCg */ +#endif + +#if !defined(_TYPEDEF_Uint32) +#define _TYPEDEF_Uint32 +typedef CriUint32 Uint32; /* ȂSoCg */ +#endif + +#if !defined(_TYPEDEF_Sint32) +#define _TYPEDEF_Sint32 +typedef CriSint32 Sint32; /* ‚SoCg */ +#endif + +#if !defined(_TYPEDEF_Uint64) +#define _TYPEDEF_Uint64 +typedef CriUint64 Uint64; /* ȂWoCg */ +#endif + +#if !defined(_TYPEDEF_Sint64) +#define _TYPEDEF_Sint64 +typedef CriSint64 Sint64; /* ‚WoCg */ +#endif + +#if !defined(_TYPEDEF_Uint128) +#define _TYPEDEF_Uint128 +typedef CriUint128 Uint128; /* Ȃ16oCg */ +#endif + +#if !defined(_TYPEDEF_Sint128) +#define _TYPEDEF_Sint128 +typedef CriSint128 Sint128; /* ‚16oCg */ +#endif + +#if !defined(_TYPEDEF_Float16) +#define _TYPEDEF_Float16 +typedef CriFloat16 Float16; /* QoCg */ +#endif + +#if !defined(_TYPEDEF_Float32) +#define _TYPEDEF_Float32 +typedef CriFloat32 Float32; /* SoCg */ +#endif + +#if !defined(_TYPEDEF_Float64) +#define _TYPEDEF_Float64 +typedef CriFloat64 Float64; /* WoCg */ +#endif + +#if !defined(_TYPEDEF_Fixed32) +#define _TYPEDEF_Fixed32 +typedef CriFixed32 Fixed32; /* Œ菬_32rbg */ +#endif + +/* X11 APIixtrapproto.hjƂ̋p */ +#if !defined(_TYPEDEF_Bool) && !defined(Bool) +#define _TYPEDEF_Bool +typedef CriBool Bool; /* _^i_萔lɂƂj */ +#endif + +#if !defined(_TYPEDEF_Char8) +#define _TYPEDEF_Char8 +typedef CriChar8 Char8; /* ^ */ +#endif + +#if !defined(_TYPEDEF_SintPtr) +#define _TYPEDEF_SintPtr +typedef CriSintPtr SintPtr; +#endif + +#if !defined(_TYPEDEF_UintPtr) +#define _TYPEDEF_UintPtr +typedef CriUintPtr UintPtr; +#endif + +#endif /* CRI_XPT_DISABLE_UNPREFIXED_TYPE */ + +#endif /* CRI_INCL_CRI_XPT_POST_H */ + +/* end of file */ diff --git a/3rdParty/cri/Durango/include/cri_xpts_durango.h b/3rdParty/cri/Durango/include/cri_xpts_durango.h new file mode 100644 index 00000000..f2e676ab --- /dev/null +++ b/3rdParty/cri/Durango/include/cri_xpts_durango.h @@ -0,0 +1,132 @@ +/**************************************************************************** + * + * CRI Middleware SDK + * + * Copyright (c) 1998-2011 CRI Middleware Co., Ltd. + * + * Library : CRI Middleware Library + * Module : CRI Common Header for XboxOne + * File : cri_xpts_xboxone.h + * Date : 2013-03-04 + * Version : 2.05 + * + ****************************************************************************/ + +#ifndef CRI_INCL_CRI_XPTS_H +#define CRI_INCL_CRI_XPTS_H + +/***************************************************************************** + * 基本データ型宣言 + *****************************************************************************/ + +#if !defined(_TYPEDEF_CriUint8) +#define _TYPEDEF_CriUint8 +typedef unsigned __int8 CriUint8; /* 符号なし1バイト整数 */ +#endif + +#if !defined(_TYPEDEF_CriSint8) +#define _TYPEDEF_CriSint8 +typedef signed __int8 CriSint8; /* 符号つき1バイト整数 */ +#endif + +#if !defined(_TYPEDEF_CriUint16) +#define _TYPEDEF_CriUint16 +typedef unsigned __int16 CriUint16; /* 符号なし2バイト整数 */ +#endif + +#if !defined(_TYPEDEF_CriSint16) +#define _TYPEDEF_CriSint16 +typedef signed __int16 CriSint16; /* 符号つき2バイト整数 */ +#endif + +#if !defined(_TYPEDEF_CriUint32) +#define _TYPEDEF_CriUint32 +typedef unsigned __int32 CriUint32; /* 符号なし4バイト整数 */ +#endif + +#if !defined(_TYPEDEF_CriSint32) +#define _TYPEDEF_CriSint32 +typedef signed __int32 CriSint32; /* 符号つき4バイト整数 */ +#endif + +#if !defined(_TYPEDEF_CriUint64) +#define _TYPEDEF_CriUint64 +typedef unsigned __int64 CriUint64; /* 符号なし8バイト整数 */ +#endif + +#if !defined(_TYPEDEF_CriSint64) +#define _TYPEDEF_CriSint64 +typedef signed __int64 CriSint64; /* 符号つき8バイト整数 */ +#endif + +#if !defined(_TYPEDEF_CriUint128) +#define _TYPEDEF_CriUint128 +typedef struct { /* 符号なし16バイト整数 */ + CriUint64 h; /* 上位64ビット */ + CriUint64 l; /* 下位64ビット */ +} CriUint128; +#endif + +#if !defined(_TYPEDEF_CriSint128) +#define _TYPEDEF_CriSint128 +typedef struct { /* 符号つき16バイト整数 */ + CriSint64 h; /* 上位64ビット */ + CriUint64 l; /* 下位64ビット */ +} CriSint128; +#endif + +#if !defined(_TYPEDEF_CriFloat16) +#define _TYPEDEF_CriFloat16 +typedef signed __int16 CriFloat16; /* 2バイト実数 */ +#endif + +#if !defined(_TYPEDEF_CriFloat32) +#define _TYPEDEF_CriFloat32 +typedef float CriFloat32; /* 4バイト実数 */ +#endif + +#if !defined(_TYPEDEF_CriFloat64) +#define _TYPEDEF_CriFloat64 +typedef double CriFloat64; /* 8バイト実数 */ +#endif + +#if !defined(_TYPEDEF_CriFixed32) +#define _TYPEDEF_CriFixed32 +typedef signed __int32 CriFixed32; /* 固定小数点32ビット */ +#endif + +#if !defined(_TYPEDEF_CriBool) +#define _TYPEDEF_CriBool +typedef CriSint32 CriBool; /* 論理型(論理定数を値にとる) */ +#endif + +#if !defined(_TYPEDEF_CriChar8) +#define _TYPEDEF_CriChar8 +typedef char CriChar8; /* 文字型 */ +#endif + +/***************************************************************************** + * ポインタを格納可能な整数型 + *****************************************************************************/ + +#if !defined(_TYPEDEF_CriSintPtr) +#define _TYPEDEF_CriSintPtr +typedef signed __int64 CriSintPtr; +#endif + +#if !defined(_TYPEDEF_CriUintPtr) +#define _TYPEDEF_CriUintPtr +typedef unsigned __int64 CriUintPtr; +#endif + +/***************************************************************************** + * 呼び出し規約 + *****************************************************************************/ + +#if !defined(CRIAPI) +#define CRIAPI __cdecl +#endif + +#endif /* CRI_INCL_CRI_XPTS_H */ + +/* end of file */ diff --git a/3rdParty/cri/PS4/include/cri_allocator.h b/3rdParty/cri/PS4/include/cri_allocator.h new file mode 100644 index 00000000..e3c18997 --- /dev/null +++ b/3rdParty/cri/PS4/include/cri_allocator.h @@ -0,0 +1,63 @@ +#ifndef _CRI_ALLOCATOR_H_INCLUDED +#define _CRI_ALLOCATOR_H_INCLUDED +/**************************************************************************** + * * + * CRI Allocator * + * * + * 2006-01-05 written by M.Oshimi * + * * + ****************************************************************************/ + +/**************************************************************************** + * Include file + ****************************************************************************/ +#include +#include "cri_xpt.h" +#include "cri_heap.h" + +/**************************************************************************** + * Macro Constants + ****************************************************************************/ +#if defined(XPT_UNSUPPORT_CPLUSPLUS_THROW) +#define CRI_ALLOCATOR_CPLUSPLUS_THROW +#else +#define CRI_ALLOCATOR_CPLUSPLUS_THROW throw() +#endif + +/**************************************************************************** + * Class Declaration + ****************************************************************************/ +#ifdef __cplusplus + +class CriAllocator +{ +public: + static const CriSint32 DEFAULT_ALIGNMENT = CRIHEAP_DEFAULT_MEM_ALIGN; + + + static void* CRIAPI operator new(size_t size, CriHeap heap) CRI_ALLOCATOR_CPLUSPLUS_THROW; + static void* CRIAPI operator new(size_t size, CriHeap heap, CriHeapType heap_type) CRI_ALLOCATOR_CPLUSPLUS_THROW; + static void* CRIAPI operator new(size_t size, CriHeap heap, const CriChar8 *name, CriUint32 align=DEFAULT_ALIGNMENT) CRI_ALLOCATOR_CPLUSPLUS_THROW; + static void* CRIAPI operator new(size_t size, CriHeap heap, CriHeapType heap_type, const CriChar8 *name, CriUint32 align=DEFAULT_ALIGNMENT) CRI_ALLOCATOR_CPLUSPLUS_THROW; + + static void CRIAPI operator delete(void *p, size_t size); + + static void* CRIAPI operator new(size_t size, void *work, CriSint32 wksize) CRI_ALLOCATOR_CPLUSPLUS_THROW; + static void CRIAPI operator delete(void *p, void *work, CriSint32 wksize) CRI_ALLOCATOR_CPLUSPLUS_THROW; + static void* CRIAPI operator new(size_t size, void *work, CriSint32 wksize, CriUint32 align) CRI_ALLOCATOR_CPLUSPLUS_THROW; + static void CRIAPI operator delete(void *p, void *work, CriSint32 wksize, CriUint32 align) CRI_ALLOCATOR_CPLUSPLUS_THROW; + +#if !defined(XPT_TGT_BCB) + static void CRIAPI operator delete(void *p, CriHeap heap) CRI_ALLOCATOR_CPLUSPLUS_THROW; + static void CRIAPI operator delete(void *p, CriHeap heap, CriHeapType heap_type) CRI_ALLOCATOR_CPLUSPLUS_THROW; + static void CRIAPI operator delete(void *p, CriHeap heap, const CriChar8 *name, CriUint32 align) CRI_ALLOCATOR_CPLUSPLUS_THROW; + static void CRIAPI operator delete(void *p, CriHeap heap, CriHeapType heap_type, const CriChar8 *name, CriUint32 align) CRI_ALLOCATOR_CPLUSPLUS_THROW; +#endif + + static CriSint32 GetWorstExtraSize(CriUint32 align); +}; +#endif // _CRI_ALLOCATOR_H_INCLUDED + +#endif /* end of __cplusplus */ + +/* --- end of file --- */ diff --git a/3rdParty/cri/PS4/include/cri_error.h b/3rdParty/cri/PS4/include/cri_error.h new file mode 100644 index 00000000..6fdd5f43 --- /dev/null +++ b/3rdParty/cri/PS4/include/cri_error.h @@ -0,0 +1,368 @@ +#ifndef _CRI_ERROR_H_INCLUDED +#define _CRI_ERROR_H_INCLUDED +/**************************************************************************** + * + * CRI Middleware SDK + * + * Copyright (c) 2006-2009 CRI Middleware Co., Ltd. + * + * Library : CRI Error + * Module : + * File : cri_error.h + * + ****************************************************************************/ +/*! + * \file cri_error.h + */ +/*JP + * \addtogroup CRI_ERROR エラーハンドリング用関数群 + * @{ + */ +/*EN + * \addtogroup CRI_ERROR Functions for error handling + * @{ + */ + +/**************************************************************************** + * Include file * + ****************************************************************************/ +#include "cri_xpt.h" + +/**************************************************************************** + * MACRO CONSTANT * + ****************************************************************************/ + +/* バージョン番号 */ +/* Version number */ +#define CRIERROR_VER_NAME "CRI Error" +#define CRIERROR_VER_NUM "1.04.00" +#define CRIERROR_VER_OPTION + +/*JP + * \brief エラーコード + */ +/*EN + * \brief Error codes + */ +typedef enum { + CRIERR_OK = 0, /*JP< 正常終了 */ + /*EN< Succeeded */ + CRIERR_NG = -1, /*JP< エラーが発生 */ + /*EN< Error occurred */ + CRIERR_INVALID_PARAMETER = -2, /*JP< 引数が不正 */ + /*EN< Invalid argument */ + CRIERR_FAILED_TO_ALLOCATE_MEMORY = -3, /*JP< メモリの確保に失敗 */ + /*EN< Failed to allocate memory */ + CRIERR_UNSAFE_FUNCTION_CALL = -4, /*JP< 非スレッドセーフ関数の並列実行 */ + /*EN< Parallel execution of thread-unsafe function */ + CRIERR_FUNCTION_NOT_IMPLEMENTED = -5, /*JP< 未実装関数の実行 */ + /*EN< Function not implemented */ + CRIERR_LIBRARY_NOT_INITIALIZED = -6, /*JP< ライブラリが未初期化 */ + /*EN< Library not initialized */ + /* enum be 4bytes */ + CRIERR_ENUM_BE_SINT32 = 0x7FFFFFFF +} CriError; + +/*JP + * \brief エラー通知レベル + */ +/*EN + * \brief Error notification level + */ +typedef enum { + CRIERR_NOTIFY_ALL = 0, /*JP< 全てのエラーを通知 */ + /*EN< Notify all errors */ + CRIERR_NOTIFY_FATAL = 1, /*JP< エラーのみ通知(警告は無視) */ + /*EN< Notify error (Disregards warning) */ + /* enum be 4bytes */ + CRIERR_NOTIFY_ENUM_BE_SINT32 = 0x7FFFFFFF +} CriErrorNotificationLevel; + +/* エラーレベル */ +/* Error level */ +typedef enum { + CRIERR_LEVEL_ERROR = 0, + CRIERR_LEVEL_WARNING = 1, + /* enum be 4bytes */ + CRIERR_LEVEL_ENUM_BE_SINT32 = 0x7FFFFFFF +} CriErrorLevel; + +/**************************************************************************** + * PROCESS MACRO * + ****************************************************************************/ + +#if defined(CRIERROR_SIMPLIFY) + /* エラーの通知 */ + /* Notification of Error */ + #define criErr_NotifyError(id, msg) criErr_NotifyErrorSimple() + #define criErr_NotifyError1(id, msg, p1) criErr_NotifyErrorSimple() + #define criErr_NotifyError2(id, msg, p1, p2) criErr_NotifyErrorSimple() + #define criErr_NotifyErrorPrmArray(id, msg, p1, p2, pa) criErr_NotifyErrorSimple() + #define criErr_NotifyErrorGeneric(_error_id, _error_no) criErr_NotifyErrorSimple() + /* 警告の通知 */ + /* Notification of Warning */ + #define criErr_NotifyWarning(id, msg) criErr_NotifyWarningSimple() + #define criErr_NotifyWarning1(id, msg, p1) criErr_NotifyWarningSimple() + #define criErr_NotifyWarning2(id, msg, p1, p2) criErr_NotifyWarningSimple() + #define criErr_NotifyWarningPrmArray(id, msg, p1, p2, pa) criErr_NotifyWarningSimple() + #define criErr_NotifyWarningGeneric(_error_id, _error_no) criErr_NotifyWarningSimple() +#else + /* エラーの通知 */ + /* Notification of Error */ + #define criErr_NotifyError(id, msg) criErr_Notify(CRIERR_LEVEL_ERROR, id ":" msg) + #define criErr_NotifyError1(id, msg, p1) criErr_Notify1(CRIERR_LEVEL_ERROR, (id ":" msg), (CriUintPtr)(p1)) + #define criErr_NotifyError2(id, msg, p1, p2) criErr_Notify2(CRIERR_LEVEL_ERROR, (id ":" msg), (CriUintPtr)(p1), (CriUintPtr)(p2)) + #define criErr_NotifyErrorPrmArray(id, msg, p1, p2, pa) criErr_NotifyPrmArray(CRIERR_LEVEL_ERROR, (id ":" msg), (CriUintPtr)(p1), (CriUintPtr)(p2), (CriUintPtr *)(pa)) + #define criErr_NotifyErrorGeneric(_error_id, _error_no) criErr_NotifyGeneric(CRIERR_LEVEL_ERROR, _error_id, _error_no) + /* 警告の通知 */ + /* Notification of Warning */ + #define criErr_NotifyWarning(id, msg) criErr_Notify(CRIERR_LEVEL_WARNING, id ":" msg) + #define criErr_NotifyWarning1(id, msg, p1) criErr_Notify1(CRIERR_LEVEL_WARNING, (id ":" msg), (CriUintPtr)(p1)) + #define criErr_NotifyWarning2(id, msg, p1, p2) criErr_Notify2(CRIERR_LEVEL_WARNING, (id ":" msg), (CriUintPtr)(p1), (CriUintPtr)(p2)) + #define criErr_NotifyWarningPrmArray(id, msg, p1, p2, pa) criErr_NotifyPrmArray(CRIERR_LEVEL_WARNING, (id ":" msg), (CriUintPtr)(p1), (CriUintPtr)(p2), (CriUintPtr *)(pa)) + #define criErr_NotifyWarningGeneric(_error_id, _error_no) criErr_NotifyGeneric(CRIERR_LEVEL_WARNING, _error_id, _error_no) +#endif + +/**************************************************************************** + * Data type declaration * + ****************************************************************************/ + +/* Error Callback Function type */ +typedef void (CRIAPI *CriErrCbFunc)(const CriChar8 *errid, CriUint32 p1, CriUint32 p2, CriUint32 *parray); + +/**************************************************************************** + * 変数の宣言 * + * Variable Declaration * + ****************************************************************************/ +/* エラー出力省略用変数 */ +/* default argument of CriError */ +#ifdef __cplusplus +namespace criErr { + extern CriError ErrorContainer; +} +#endif /* __cplusplus */ + +/**************************************************************************** + * 関数の宣言 * + * Function Declaration * + ****************************************************************************/ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +/*JP + * \brief エラーID文字列からエラーメッセージへ変換 + * \ingroup CRI_ERROR + * \param[in] errid エラーID文字列 + * \return エラーメッセージ + * \par 説明: + * エラーID文字列から詳細なエラーメッセージへ変換します。
+ * \attention + * この関数は旧仕様の関数です。
+ * 代わりに ::criErr_ConvertIdToMessage 関数を使用してください。 + * \sa criErr_ConvertIdToMessage + */ +/*EN + * \brief Convert error ID to error message + * \ingroup CRI_ERROR + * \param[in] errid error ID + * \return error message + * \par Explanation: + * This function converts error ID to detailed error message.
+ * \attention + * This function is an obsolete one.
+ * Please use the ::criErr_ConvertIdToMessage function instead. + * \sa criErr_ConvertIdToMessage + */ +const CriChar8* CRIAPI criErr_ConvertIdToMsg(const CriChar8 *errid); + +/*JP + * \brief エラーID文字列からエラーメッセージへ変換 + * \ingroup CRI_ERROR + * \param[in] errid エラーID文字列 + * \param[in] p1 補足情報1 + * \param[in] p2 補足情報2 + * \return エラーメッセージ + * \par 説明: + * エラーID文字列から詳細なエラーメッセージへ変換します。
+ * \par 用例: + * \code + * void user_error_callback_func(const CriChar8 *errid, CriUint32 p1, CriUint32 p2, CriUint32 *parray); + * { + * const CriChar8 *errmsg; + * errmsg = criErr_ConvertIdToMessage(errid, p1, p2); + * printf("%s\n", errmsg); + * } + * \endcode + */ +/*EN + * \brief Convert error ID to error message + * \ingroup CRI_ERROR + * \param[in] errid error ID + * \param[in] p1 supplementary information 1 + * \param[in] p2 supplementary information 2 + * \return error message + * \par Explanation: + * This function converts error ID to detailed error message.
+ * \par Example: + * \code + * void user_error_callback_func(const CriChar8 *errid, CriUint32 p1, CriUint32 p2, CriUint32 *parray); + * { + * const CriChar8 *errmsg; + * errmsg = criErr_ConvertIdToMessage(errid, p1, p2); + * printf("%s\n", errmsg); + * } + * \endcode + */ +const CriChar8* CRIAPI criErr_ConvertIdToMessage(const CriChar8 *errid, CriUint32 p1, CriUint32 p2); + +/*JP + * \brief エラーコールバック関数の登録 + * \ingroup CRI_ERROR + * \param[in] cbf エラーコールバック関数 + * \return なし + * \par 説明: + * エラーコールバック関数を登録します。
+ * 登録された関数は、CRIミドルウエアライブラリ内でエラーが発生したときに呼び出されます。
+ * 同時に登録できるエラーコールバック関数は1つです。
+ * 登録後に再度本関数を呼び出した場合は現在の登録を上書きします。 + * \par 用例: + * \code + * void user_error_callback_func(const CriChar8 *errid, CriUint32 p1, CriUint32 p2, CriUint32 *parray); + * { + * const CriChar8 *errmsg; + * errmsg = criErr_ConvertIdToMessage(errid, p1, p2); + * printf("%s\n", errmsg); + * } + * + * void main(int ac, char *av[]) + * { + * : + * // エラーコールバックの登録 + * criErr_SetCallback(user_error_callback_func); + * : + * } + * \endcode + */ +/*EN + * \brief Register error callback function + * \ingroup CRI_ERROR + * \param[in] cbf error callback function + * \return NONE + * \par Explanation: + * This function registers an error callback function.
+ * The registered function is called if an error occurs within the CRI middleware library. + * \par Example: + * \code + * void user_error_callback_func(const CriChar8 *errid, CriUint32 p1, CriUint32 p2, CriUint32 *parray); + * { + * const CriChar8 *errmsg; + * errmsg = criErr_ConvertIdToMessage(errid, p1, p2); + * printf("%s\n", errmsg); + * } + * + * void main(int ac, char *av[]) + * { + * : + * // Registers the error callback function + * criErr_SetCallback(user_error_callback_func); + * : + * } + * \endcode + */ +void CRIAPI criErr_SetCallback(CriErrCbFunc cbf); + +/*JP + * \brief エラー通知レベルの変更 + * \ingroup CRI_ERROR + * \param[in] level エラー通知レベル + * \return なし + * \par 説明: + * エラーコールバックに通知するエラーのレベルを変更します。 + */ +/*EN + * \brief Change error notification level + * \ingroup CRI_ERROR + * \param[in] level error notification level + * \return NONE + * \par Explanation: + * This function changes the level of error information that is notified to the error callback. + */ +void CRIAPI criErr_SetErrorNotificationLevel(CriErrorNotificationLevel level); + +/*JP + * \brief エラー発生回数の取得 + * \ingroup CRI_ERROR + * \param[in] level エラーレベル + * \return エラー発生回数 + * \par 説明: + * エラー発生回数を取得します。 + */ +/*EN + * \brief Retrieve error count + * \ingroup CRI_ERROR + * \param[in] level error level + * \return number of errors occured + * \par Explanation: + * This function retrieves the number of errors occured. + */ +CriUint32 CRIAPI criErr_GetErrorCount(CriErrorLevel level); + +/*JP + * \brief エラー発生回数のリセット + * \ingroup CRI_ERROR + * \param[in] level エラーレベル + * \return なし + * \par 説明: + * エラー発生回数のカウンタを0に戻します。 + */ +/*EN + * \brief Resets error count + * \ingroup CRI_ERROR + * \param[in] level error level + * \return NONE + * \par Explanation: + * This function resets the counter for number of errors occured. + */ +void CRIAPI criErr_ResetErrorCount(CriErrorLevel level); + +/* エラーコールバックを発生させる (内部関数) */ +/* Error notification (Internal functions) */ +void CRIAPI criErr_Notify(CriErrorLevel level, const CriChar8 *errid); +void CRIAPI criErr_Notify1(CriErrorLevel level, const CriChar8 *errid, CriUintPtr p1); +void CRIAPI criErr_Notify2(CriErrorLevel level, const CriChar8 *errid, CriUintPtr p1, CriUintPtr p2); +void CRIAPI criErr_NotifyPrmArray(CriErrorLevel level, const CriChar8 *errid, CriUintPtr p1, CriUintPtr p2, CriUintPtr *pa); +void CRIAPI criErr_NotifyGeneric(CriErrorLevel level, const CriChar8 *error_id, CriError error_no); +void CRIAPI criErr_NotifyErrorSimple(void); +void CRIAPI criErr_NotifyWarningSimple(void); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +/*************************************************************************** + * 旧バージョンとの互換用 + * For compatibility with old versions + ***************************************************************************/ +#define criErr_Invoke(errid) criErr_Notify(CRIERR_LEVEL_ERROR, errid) +#define criErr_Invoke1(errid, p1) criErr_Notify1(CRIERR_LEVEL_ERROR, errid, p1) +#define criErr_Invoke2(errid, p1, p2) criErr_Notify2(CRIERR_LEVEL_ERROR, errid, p1, p2) +#define criErr_InvokePrmArray(errid, p1, p2, pa) criErr_NotifyPrmArray(CRIERR_LEVEL_ERROR, errid, p1, p2, pa) +#define criErr_InvokeGeneric(error_id, error_no) criErr_NotifyGeneric(CRIERR_LEVEL_ERROR, error_id, error_no) +#define criErr_Occur(id, msg) criErr_Notify(CRIERR_LEVEL_ERROR, id ":" msg) +#define criErr_Occur1(id, msg, p1) criErr_Notify1(CRIERR_LEVEL_ERROR, (id ":" msg), (CriUintPtr)(p1)) +#define criErr_Occur2(id, msg, p1, p2) criErr_Notify2(CRIERR_LEVEL_ERROR, (id ":" msg), (CriUintPtr)(p1), (CriUintPtr)(p2)) +#define criErr_OccurPrmArray(id, msg, p1, p2, pa) criErr_NotifyPrmArray(CRIERR_LEVEL_ERROR, (id ":" msg), (CriUintPtr)(p1), (CriUintPtr)(p2), (CriUintPtr*)(pa)) +#define criErr_OccurGeneric(_error_id, _error_no) criErr_NotifyGeneric(CRIERR_LEVEL_ERROR, _error_id, _error_no) + +/*EN + * @} + */ +/*JP + * @} + */ + +#endif // _CRI_ERROR_H_INCLUDED + +/* --- end of file --- */ diff --git a/3rdParty/cri/PS4/include/cri_heap.h b/3rdParty/cri/PS4/include/cri_heap.h new file mode 100644 index 00000000..49e85012 --- /dev/null +++ b/3rdParty/cri/PS4/include/cri_heap.h @@ -0,0 +1,640 @@ +#ifndef _CRI_HEAP_H_INCLUDED +#define _CRI_HEAP_H_INCLUDED +/**************************************************************************** + * * + * CRI Heap Manager "CriHeap" Library * + * * + * 2005-03-17 written by satouo * + * * + ****************************************************************************/ +/*! + * \file cri_heap.h + */ + +/**************************************************************************** + * インクルードファイル * + * Include file * + ****************************************************************************/ +#include "cri_xpt.h" + +#ifdef XPT_TGT_PC +#pragma pack(push) +#pragma pack(1) //The boundary value of structure is adjusted to 1 byte. +#endif + +/**************************************************************************** + * 定数マクロ * + * MACRO CONSTANT * + ****************************************************************************/ +/* Version number of CRIHEAP */ +#define CRIHEAP_NAME_STRINGS "CRI Heap" +#define CRIHEAP_VERSION_STRINGS "1.21.02" + +/* Default memory alignment */ +#define CRIHEAP_DEFAULT_MEM_ALIGN (8) + +/**************************************************************************** + * 列挙定数マクロ * + * ENUM CONSTANT * + ****************************************************************************/ +/*JP + * \brief メモリのタイプ + */ +/*EN + * \brief Types of heap + */ +typedef enum { + CRIHEAP_TYPE_FIX = (1), + CRIHEAP_TYPE_TEMPORARY = (2), + CRIHEAP_TYPE_DYNAMIC = (3), // unuse + CRIHEAP_TYPE_NONE = (0), + /* enum be 4bytes */ + CRIHEAP_TYPE_ENUM_BE_SINT32 = 0x7FFFFFFF +} CriHeapType; + +/**************************************************************************** + * データ型 * + * Data type declaration * + ****************************************************************************/ +/* CriHeapハンドル */ +/* CriHeap handle */ +#ifndef CRIHEAP_DEFINED +#define CRIHEAP_DEFINED + +/* internal */ +typedef struct CriHeapBlockTag { + struct CriHeapBlockTag *prevblock; + struct CriHeapBlockTag *nextblock; + CriSint32 memsize; + CriUint8 used; + CriUint8 type; + CriUint16 alignspc; + CriUint16 gap; + CriChar8 *nameadr; +} CriHeapBlock, *CriHeapBlockPtr; + +/*JP + * \brief CRI Heapハンドル + * \struct CriHeap + * \ingroup CRIHEAP_BASIC + * CRI Heapを用いてメモリアロケートを行うために必要なハンドルです。
+ * このハンドルに対して、メモリアロケートやメモリフリーを行います。 + * \sa criHeap_Create(), criHeap_Destroy() + */ +/*EN + * \brief CRI Heap handle + * \struct CriHeap + * \ingroup CRIHEAP_BASIC + * \par Description: + * The heap handle. This data structure needs to exist through the life cycle of + * the heap. It allows the library to allocate and deallocate memory + * internally within the heap. Typically this handle gets allocated at the + * beginning of the heap memory that you've provided for the heap, but don't + * depend on this behavior. The heap itself is opaque. You can of course + * allocate multiple non-contiguous heaps, but these will be separate heap + * structures and a single allocation won't choose between them. + * + * \sa criHeap_Create(), criHeap_Destroy() + */ +typedef struct _criheap_struct { + struct _criheap_vfunctiontable *vtbl; + CriSint32 totalsize; + CriSint32 peaksize; + CriSint32 currentsize; + CriHeapBlock *topblock; + CriHeapBlock *taleblock; +} CriHeapObj, *CriHeap; + +/*JP + * \brief CRI Heap仮想関数テーブル + * \struct criHeapVirtualFunctionTable + * \ingroup CRIHEAP_BASIC + * 独自のメモリアロケート関数を実装する際に使用する仮想関数テーブル構造体です。
+ * 各関数はマルチスレッドセーフである必要があります。
+ * \par 備考: + * 3番目のアロケート関数は現在未使用です。 + */ +/*EN + * \brief CRI Heap Virtual Function Table + * \struct criHeapVirtualFunctionTable + * \ingroup CRIHEAP_BASIC + * \par Description: + * The virtual functions table for original allocation functions.
+ * The third allocation function is not in use currently. + */ +typedef struct _criheap_vfunctiontable { + /*JP + * \brief メモリのアロケート(メモリ領域の先端から) + * \par 説明: + * criHeap_AllocFix関数呼び出し時に呼ばれます。 + * \sa criHeap_AllocFix() + */ + /*EN + * \brief Memory allocation (allocating from the top of the memory area) + * \par Description: + * Called from criHeap_AllocFix(). + * \sa criHeap_AllocFix() + */ + void *(*AllocFix)(CriHeap heap, CriSint32 size, const CriChar8 *name, CriSint32 align); + /*JP + * \brief メモリのアロケート(メモリ領域の終端から) + * \par 説明: + * criHeap_AllocFix関数呼び出し時に呼ばれます。 + * \sa criHeap_AllocTemporary() + */ + /*EN + * \brief Memory allocation (allocating from the tail of the memory area) + * \par Description: + * Called from criHeap_AllocTemporary(). + * \sa criHeap_AllocTemporary() + */ + void *(*AllocTemporary)(CriHeap heap, CriSint32 size, const CriChar8 *name, CriSint32 align); + /*JP + * \brief 未使用関数 + */ + /*EN + * \brief Unused + */ + void *(*AllocDynamic)(CriHeap heap, CriSint32 size, const CriChar8 *name, CriSint32 align); // unused + + /*JP + * \brief メモリのフリー + * \par 説明: + * criHeap_Free関数呼び出し時に呼ばれます。 + * \sa criHeap_Free() + */ + /*EN + * \brief Memory deallocation + * \par Description: + * Called from criHeap_Free(). + * \sa criHeap_Free() + */ + CriSint32 (*Free)(CriHeap heap, void *ptr); +} criHeapVirtualFunctionTable; + +#endif + + +/**************************************************************************** + * 関数の宣言 + * Function Declaration + ****************************************************************************/ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +/*==========================================================================* + * ライブラリの初期化と終了処理 + * Initialize and Finalize of Library + *==========================================================================*/ +/*JP + * \brief CRI Heapライブラリの初期化 + * \ingroup CRIHEAP_BASIC + * \par 説明: + * CRI Heapライブラリを使用するために必要な初期化関数です。
+ * CRI Heapを使用する際はあらかじめ本関数をコールする必要があります。 + * \sa criHeap_Finalize() + */ +/*EN + * \brief Initialize the heap manager. + * \ingroup CRIHEAP_BASIC + * \par Description: + * This function initializes the heap manager and prepares it to manage heaps. + * This function only has an effect the first time it is called in your program. + * Subsequent calls only increment an internal counter. This allows your + * program to call criHeap_Initialize() in pairs with criHeap_Finalize() + * throughout your program modules, and only the initial call to criHeap_Initialize() + * and the final call to criHeap_Finalize() will have any effect. + * \if ps2 + * \par PS2 only: + * This function does a sanity check to make sure that the size of the CriHeapObj + * data structure is a factor of 16. If it is not a factor of 16, this function + * hangs. + * \endif + * \sa criHeap_Finalize() + */ +void CRIAPI criHeap_Initialize(void); + +/*JP + * \brief CRI Heapライブラリの終了 + * \ingroup CRIHEAP_BASIC + * \par 説明: + * CRI Heapライブラリを終了するために必要な終了関数です。
+ * CRI Heapの使用を終了する際は本関数をコールしてください。 + * \sa criHeap_Initialize() + */ +/*EN + * \brief Finalize the heap manager. + * \ingroup CRIHEAP_BASIC + * \par Description: + * This function finalizes the heap manager. If the criHeap_Initialize() function + * is called n times, then the nth time that criHeap_Finalize() + * is called, this function invalidates any heaps currently in use. Calling + * any heap function after the nth call to criHeap_Finalize() will + * have unpredictable results. + * \sa criHeap_Initialize() + */ +void CRIAPI criHeap_Finalize(void); + +/*==========================================================================* + * ハンドルの生成・解放 + *==========================================================================*/ +/*JP + * \brief CRI Heapハンドルの生成 + * \ingroup CRIHEAP_BASIC + * \param ptr メモリ領域のポインタ。 + * \param size メモリ領域のサイズ。 + * \return CRI Heapハンドル。
生成に失敗した場合は、NULLが返ります。 + * \par 説明: + * CRI Heapハンドルを生成します。
+ * 本関数で与えるメモリ領域は、CRI Heap自身のハンドル領域やアロケート時に + * 確保されるメモリ領域となります。
+ * 管理領域を含むため、メモリ領域すべてがアロケート出来ない点に注意してください。 + * 管理領域の目安は「1ハンドルあたりsizeof(CriHeapObj)」+「1アロケートあたり + * sizeof(CriHeapBlock)+各メモリアライメントに必要なサイズ」となります。 + * \code + * CriChar8 heap_buffer[0x2000]; + * CriHeap heap = criHeap_Create((void *)heap_buffer, sizeof(heap_buffer); + * \endcode + * \sa criHeap_Destroy() + */ +/*EN + * \brief Create a contiguous heap in memory. + * \ingroup CRIHEAP_BASIC + * \param ptr A pointer to the start of the memory region to use as a heap. + * \param size The size of the region to be used as a heap. + * \return A valid CriHeap handle if successful, or NULL if unsuccessful. + * \par Description: + * This function allows you to set aside a region of memory for this library's + * use as a "heap". Heap allocation is required before active playback + * can begin. + * This function will fail and return NULL if the size of the memory region + * is smaller than the CriHeapObj structure. + * \code + * CriChar8 heap_buffer[0x2000]; + * CriHeap heap = criHeap_Create((void *)heap_buffer, sizeof(heap_buffer); + * \endcode + * \sa criHeap_Destroy() + */ +CriHeap CRIAPI criHeap_Create(void *ptr, CriSint32 size); + +/*JP + * \brief 非スレッドセーフなCRI Heapハンドルの生成 + * \ingroup CRIHEAP_BASIC + * \param ptr メモリ領域のポインタ。 + * \param size メモリ領域のサイズ。 + * \return CRI Heapハンドル。
生成に失敗した場合は、NULLが返ります。 + * \par 説明: + * CRI Heapハンドルを生成します。
+ * 本関数を使用して作成されたヒープは、排他制御が行なわれません。
+ * 複数スレッドから同時に参照されるヒープの作成には、criHeap_Create関数をご利用ください。 + * \sa criHeap_Create(), criHeap_Destroy() + */ +/*EN + * \brief Create a contiguous heap in memory. + * \ingroup CRIHEAP_BASIC + * \param ptr A pointer to the start of the memory region to use as a heap. + * \param size The size of the region to be used as a heap. + * \return A valid CriHeap handle if successful, or NULL if unsuccessful. + * \par Description: + * This function creates a heap to use the static memory as dynamically allocatable memory. + * The heap created by using this function is not threadsafe. + * If heap will be accessed by multiple threads, you must create the heap by using the criHeap_Create function. + * \sa criHeap_Create(), criHeap_Destroy() + */ +CriHeap CRIAPI criHeap_CreateNoSerialize(void *ptr, CriSint32 size); + +/*JP + * \brief CRI Heapハンドルの解放 + * \ingroup CRIHEAP_BASIC + * \param heap CRI Heapハンドル。 + * \par 説明: + * CRI Heapハンドルを解放します。
criHeap_Create() で指定されたメモリ領域が + * 解放され、CRI Heapハンドルは無効となります。 + * \sa criHeap_Create() + */ +/*EN + * \brief Destroy a previously created heap. + * \ingroup CRIHEAP_BASIC + * \param heap A CriHeap handle previously created with criHeap_Create(). + * \par Description: + * This function frees all internal allocations previously performed on + * the heap and frees the memory. Internally, this function does in + * fact walk through the heap, finding and freeing all allocations, e.g. + * it is not stubbed. So calling this function on a trashed heap + * will have unpredictable results. + * \sa criHeap_Create() + */ +void CRIAPI criHeap_Destroy(CriHeap heap); + +/*==========================================================================* + * Allocation + *==========================================================================*/ +/*JP + * \brief メモリのアロケート(メモリ領域の先端から) + * \ingroup CRIHEAP_ALLOC + * \param heap CRI Heapハンドル。 + * \param size アロケートするメモリのサイズ。 + * \param name アロケートするメモリの名前。名前はデバッグ時に使用されます。 + * \param align アロケートするメモリのアライメント。 + * \return アロケートしたメモリへのポインタ。
アロケートに失敗した場合はNULLが返ります。 + * \par 説明: + * メモリ領域の先端側から確保するメモリアロケーション関数です。ヒープ領域内に\ref block_fix "Fixブロック"を作成します。
+ * メモリの断片化を防ぐため、同じサイズ/アライメントの解放済み\ref block_fix "Fixブロック"を先端側から探して、再利用するように試みます。それが見つからない場合は、未使用の空き領域(\ref block_free "Freeブロック")を分割してメモリを取得します。 + * \code + * CriChar8 heap_buffer[0x2000]; + * CriHeap heap = criHeap_Create((void *)heap_buffer, sizeof(heap_buffer); + * void *memptr = criHeap_AllocFix(heap, 0x100, "forTexture1", 64); + * \endcode + * \sa criHeap_AllocTemporary(), criHeap_Free() + */ +/*EN + * \brief Memory allocation (allocating from the top of the memory area) + * \ingroup CRIHEAP_ALLOC + * \param heap CRI Heap handle + * \param size Memory block size to be allocated + * \param name Memory block name, which is used on debugging + * \param align Memory block alignment + * \return A pointer to the allocated memory block.
Returns NULL if unsuccessful. + * \par Description: + * This function allocates a memory block from the top of the memory area and creates a \ref block_fix "Fix block" in the heap area.
+ * To prevent memory fragmentation, a released \ref block_fix "Fix block" with the same size and alignment is searched for in the heap area from the top to the bottom and tries to reused the block. And if not found, an unused free block (\ref block_free "Free block") is divided and a new block is allocated. + * \code + * CriChar8 heap_buffer[0x2000]; + * CriHeap heap = criHeap_Create((void *)heap_buffer, sizeof(heap_buffer); + * void *memptr = criHeap_AllocFix(heap, 0x100, "forTexture1", 64); + * \endcode + * \sa criHeap_AllocTemporary(), criHeap_Free() + */ +void * CRIAPI criHeap_AllocFix(CriHeap heap, CriSint32 size, const CriChar8 *name, CriSint32 align); + +/*JP + * \brief メモリのアロケート(メモリ領域の終端から) + * \ingroup CRIHEAP_ALLOC + * \param heap CRI Heapハンドル。 + * \param size アロケートするメモリのサイズ。 + * \param name アロケートするメモリの名前。名前はデバッグ時に使用されます。 + * \param align アロケートするメモリのアライメント。 + * \return アロケートしたメモリへのポインタ。
アロケートに失敗した場合はNULLが返ります。 + * \par 説明: + * メモリ領域の終端側から確保するメモリアロケーション関数です。ヒープ領域内に\ref block_temporary "Temporaryブロック"を作成します。
+ * 要求したサイズ/アライメントをアロケート可能な解放済み\ref block_temporary "Temporaryブロック"を終端側から探して、分割または再利用するように試みます。それが見つからない場合は、未使用の空き領域(\ref block_free "Freeブロック")を分割してメモリを取得します。
+ * ヒープ領域の終端側からメモリをアロケートするため、先端側での断片化を防ぐことが出来ます。
+ * 主に、一時的に利用するメモリに使用します。 + * \sa criHeap_AllocFix(), criHeap_Free() + */ +/*EN + * \brief Memory allocation (allocating from the tail of the memory area) + * \ingroup CRIHEAP_ALLOC + * \param heap CRI Heap handle + * \param size Memory block size to be allocated + * \param name Memory block name, which is used on debugging + * \param align Memory block alignment + * \return A pointer to the allocated memory block.
Returns NULL if unsuccessful. + * \par Description: + * This function allocates a memory block from the bottom of the memory area and creates a \ref block_temporary "Temporary block" in the heap area.
+ * A released \ref block_temporary "Temporary block" available with the requested size and alignment is searched for in the heap area from the bottom and tries to divide and to reuse the block. And if not found, an unused free block (\ref block_free "Free block") is divided and a new block is allocated.
+ * Allocating from the bottom of the heap area will prevent fragmentation in the top of the heap area.
+ * Temporary block is mainly used for the memory area that is temporarily used. + * \sa criHeap_AllocFix(), criHeap_Free() + */ +void * CRIAPI criHeap_AllocTemporary(CriHeap heap, CriSint32 size, const CriChar8 *name, CriSint32 align); + +/* DYNAMIC (unuse) */ +//void * CRIAPI criHeap_AllocDynamic(CriHeap heap, CriSint32 size, const CriChar8 *name, CriSint32 align); + +void * CRIAPI criHeap_Alloc(CriHeap heap, CriSint32 size, const CriChar8 *name, CriSint32 align, CriSint32 type); + +/*==========================================================================* + * Free + *==========================================================================*/ +/*JP + * \brief メモリのフリー + * \ingroup CRIHEAP_ALLOC + * \param heap CRI Heapハンドル。 + * \param ptr アロケートしたメモリのポインタ。 + * \return フリーされたメモリサイズ。 + * \par 説明: + * アロケートされたメモリをフリーします。
+ * \code + * void *memptr = criHeap_AllocFix(heap, 0x100, "forTexture1", 64); + * criHeap_Free(heap, memptr); + * \endcode + * \sa criHeap_AllocFix(), criHeap_AllocTemporary() + */ +/*EN + * \brief Memory deallocation + * \ingroup CRIHEAP_ALLOC + * \param heap CRI Heap handle + * \param ptr The pointer to the allocated memory block + * \return Deallocated memory block size + * \par Description: + * This function deallocates the allocated memory block.
+ * \code + * void *memptr = criHeap_AllocFix(heap, 0x100, "forTexture1", 64); + * criHeap_Free(heap, memptr); + * \endcode + * \sa criHeap_AllocFix(), criHeap_AllocTemporary() + */ +CriSint32 CRIAPI criHeap_Free(CriHeap heap, void *ptr); + +/*==========================================================================* + * 排他制御用関数 + *==========================================================================*/ +CriSint32 CRIAPI criHeap_EnterCriticalSection(void); +CriSint32 CRIAPI criHeap_LeaveCriticalSection(void); + +/*==========================================================================* + * その他の関数 + *==========================================================================*/ +/* For only internal use */ +CriSint32 CRIAPI criHeap_SwitchAllocFunctions(CriHeap heap); + +/*==========================================================================* + * デバッグ関連 + *==========================================================================*/ +/*JP + * \brief ピークメモリサイズの取得 + * \ingroup CRIHEAP_DEBUG + * \param heap CRI Heapハンドル。 + * \return 使用されたメモリの最大値。 + * \par 説明: + * 過去、使用されたメモリ量の最大値を返します。
+ * 最大値はcriHeap_DebugResetPeakMemorySize() でリセットすることが出来ます。 + * \sa criHeap_DebugResetPeakMemorySize() + */ +/*EN + * \brief Returns peak memory usage of the heap. + * \ingroup CRIHEAP_DEBUG + * \param heap The heap previously allocated by criHeap_Create(). + * \return The maximum number of bytes used by the heap. + * \par Description: + * The amount of memory used by these libraries is variable and depends + * on the number of simultaneous streams being read, the seek and error + * frequency within the stream being read, video resolution and other + * factors. This function allows you to tune the allocation of the heap + * to achieve a required performance level while allocating minimal + * heap space for this library. To get accurate readings, this function + * should typically be called just before criHeap_Destroy(), and after + * exercising all the video and audio functions in your program. + */ +CriSint32 CRIAPI criHeap_DebugGetPeakMemorySize(CriHeap heap); + +/*JP + * \brief ピークメモリサイズのリセット + * \ingroup CRIHEAP_DEBUG + * \param heap CRI Heapハンドル。 + * \par 説明: + * ピークメモリサイズをリセットします。 + * \sa criHeap_DebugGetPeakMemorySize() + */ +/*EN + * \brief Reset peak memory size + * \ingroup CRIHEAP_DEBUG + * \param heap CRI Heap handle + * \par Description: + * The peak memory size is reset. + * \sa criHeap_DebugGetPeakMemorySize() + */ +void CRIAPI criHeap_DebugResetPeakMemorySize(CriHeap heap); + +/*JP + * \brief メモリブロック数の取得 + * \ingroup CRIHEAP_DEBUG + * \param heap CRI Heapハンドル。 + * \return メモリブロック数。 + * \par 説明: + * アロケートされたメモリのブロック数を返します。
+ * CRI Heapハンドル生成直後は未使用のメモリブロックが1つ存在する状態 + * となります。また、フリーされた断片化されたメモリブロックもこの数に + * 含みます。 + * \sa criHeap_DebugGetUsedBlocks() + */ +/*EN + * \brief Get number of allocated memory blocks + * \ingroup CRIHEAP_DEBUG + * \param heap CRI Heap handle + * \return Number of allocated memory blocks + * \par Description: + * The number of allocated memory blocks is returned.
+ * One unused memory block exists right after CRI Heap handle creation. + * The number of released fragmented memory blocks is also included. + * \sa criHeap_DebugGetUsedBlocks() + */ + CriSint32 CRIAPI criHeap_DebugGetNumBlocks(CriHeap heap); + +/*JP + * \brief 使用メモリブロック数の取得 + * \ingroup CRIHEAP_DEBUG + * \param heap CRI Heapハンドル。 + * \return 使用メモリブロック数。 + * \par 説明: + * アロケートされているメモリブロックの数を返します。 + * \sa criHeap_DebugGetNumBlocks() + */ +/*EN + * \brief Get number of used memory blocks + * \ingroup CRIHEAP_DEBUG + * \param heap CRI Heap + * \return Number of used memory blocks + * \par Description: + * The number of used memory blocks is returned.
+ * \sa criHeap_DebugGetNumBlocks() + */ +CriSint32 CRIAPI criHeap_DebugGetUsedBlocks(CriHeap heap); + +/*JP + * \brief メモリブロック名の取得 + * \ingroup CRIHEAP_DEBUG + * \param heap CRI Heapハンドル。 + * \param ptr アロケートしたメモリのポインタ。 + * \return メモリブロック名。 + * \par 説明: + * アロケート時に設定したメモリブロック名へのポインタを返します。
+ */ +/*EN + * \brief Get memory block name + * \ingroup CRIHEAP_DEBUG + * \param heap CRI Heap + * \param ptr A pointer to the allocated memory block + * \return Memory block name + * \par Description: + * The pointer to the memory block name specified on allocation is returned.
+ */ +CriChar8 * CRIAPI criHeap_DebugGetBlockName(CriHeap heap, void *ptr); + +/* メモリブロック番号の取得 */ +//CriSint32 CRIAPI criHeap_DebugGetBlockNumberFromPointer(CriHeap heap, void *ptr); + +/* メモリブロック情報の取得 */ +//void CRIAPI criHeap_DebugGetBlockInformation(CriHeap heap, +// CriSint32 blocknumber, CriHeapBlock *heapblock); + +/* メモリブロック情報の表示 */ +//void CRIAPI criHeap_DebugPrintBlockInformation(CriHeap heap, +// CriSint32 blocknumber, CriHeapBlock *heapblock); + +/*JP + * \brief メモリブロック情報の表示 + * \ingroup CRIHEAP_DEBUG + * \param heap CRI Heapハンドル。 + * \par 説明: + * 現在のメモリブロック情報を表示します。
+ * printf関数などの標準出力に表示を行います。 + */ +/*EN + * \brief Print memory block information + * \ingroup CRIHEAP_DEBUG + * \param heap CRI Heap + * \par Description: + * The current memory block information is displayed.
+ * It is displayed on the standard output for the printf function. + */ + void CRIAPI criHeap_DebugPrintBlockInformationAll(CriHeap heap); + +/*JP + * \brief メモリアロケートサイズの取得 + * \ingroup CRIHEAP_DEBUG + * \param heap CRI Heapハンドル。 + * \par 説明: + * 現在のメモリアロケートサイズの合計値を返します。 + */ +/*EN + * \brief Get total allocation size + * \ingroup CRIHEAP_DEBUG + * \param heap CRI Heap + * \par Description: + * The total size of allocated memory blocks is returned. + */ +CriSint32 CRIAPI criHeap_DebugGetTotalAllocSize(CriHeap heap); + +/* フリーサイズの取得 */ +//CriSint32 CRIAPI criHeap_DebugGetTotalFreeSize(CriHeap heap); + +/* メモリアロケートサイズの取得(タイプ別) */ +CriSint32 CRIAPI criHeap_DebugGetAllocSize(CriHeap heap, CriSint32 type); + +/* ヒープヘッダサイズの取得 */ +CriSint64 CRIAPI criHeap_DebugGetHandleHeaderSize(CriHeap heap); + +/* メモリブロックヘッダサイズの取得 ptr: Allocated Pointer */ +CriSint64 CRIAPI criHeap_DebugGetMemBlockHeaderSize(void *ptr); + +/* 追加で必要となるサイズの最大値 */ +CriSint32 CRIAPI criHeap_DebugGetWorstExtraSize(CriSint32 alignment); + +/* criHeap_AllocFixでアロケート可能なサイズ */ +CriSint32 CRIAPI criHeap_DebugGetFixAllocatableSize(CriHeap heap, CriSint32 alignment); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#ifdef XPT_TGT_PC +#pragma pack(pop) +#endif + +#endif // _CRI_HEAP_H_INCLUDED + +/* end of file */ diff --git a/3rdParty/cri/PS4/include/cri_movie.h b/3rdParty/cri/PS4/include/cri_movie.h new file mode 100644 index 00000000..7259993f --- /dev/null +++ b/3rdParty/cri/PS4/include/cri_movie.h @@ -0,0 +1,4402 @@ +/**************************************************************************** + * + * CRI Middleware SDK + * + * Copyright (c) 2006-2013 CRI Middleware Co., Ltd. + * + * Library : CRI Movie + * Module : Library User's Header + * File : cri_movie.h + * Date : 2013-11-27 + * Version : (see CRIMOVIE_VER) + * + ****************************************************************************/ +/*! + * \file cri_movie.h + */ +#ifndef CRI_MOVIE_H_INCLUDED /* Re-definition prevention */ +#define CRI_MOVIE_H_INCLUDED + +/* Version No. */ +#define CRIMOVIE_VER "3.50" +#define CRIMOVIE_NAME "CRI Movie" + +/*************************************************************************** + * Include file + ***************************************************************************/ +#include +#include +#include +#include +#include +#include + +/*************************************************************************** + * MACRO CONSTANT + ***************************************************************************/ +/*EN + * \brief Maximum length of a filename that can be opened by EasyPlayer + * \ingroup MDL_MV_OPTION + * \sa CriMvEasyPlayer::SetFile() + */ +/*JP + * \brief EasyPlayerに指定可能なファイル名の最大長さ + * \ingroup MDL_MV_OPTION + * \sa CriMvEasyPlayer::SetFile() + */ +#define CRIMV_MAX_FILE_NAME (256) + +/*EN + * \brief Default audio track setting used by AttachSubAudioInterface(), ReplaceCenterVoice() + * \ingroup MDL_MV_OPTION + * \sa CriMvEasyPlayer::ReplaceCenterVoice(), CriMvEasyPlayer::AttachSubAudioInterface() + */ +/*JP + * \brief サブオーディオ(またはセンターボイス)のデフォルト値 + * \ingroup MDL_MV_OPTION + * \sa CriMvEasyPlayer::ReplaceCenterVoice(), CriMvEasyPlayer::AttachSubAudioInterface() + */ +#define CRIMV_CENTER_VOICE_OFF (-1) + + +/*************************************************************************** + * Variable Declaration + ***************************************************************************/ +namespace CriMv { + extern CriError ErrorContainer; +} + +/*************************************************************************** + * Prototype Functions + ***************************************************************************/ +/*EN + * \brief CRI Movie Namespace + * \ingroup MDL_MV_BASIC + * \par + * Namespace for all CRI Movie methods, constants, and declarations + */ +/*JP + * \brief CRI Movie Namespace + * \ingroup MDL_MV_BASIC + * \par + * Namespace for all CRI Movie methods, constants, and declarations + */ +namespace CriMv { + + /*EN + * \brief Returns the version number and build information of CRI Movie + * \param none + * \return A string constant + * + * Returns the version number and build information of CRI Movie as a constant + * string, in the form + * + * "CRI Movie/{PLATFORM} {VERSION} Build:{BUILD DATE}" + */ + /*JP + * \brief CRI Movieのバージョン番号やビルド情報を返します。 + * \return ライブラリ情報文字列 + * + */ + const CriChar8* CRIAPI GetLibraryVersionString(void); + + /*EN + * \brief Initialize the CRI Movie library + * \param err Optional error code + * + * Does one-time initialization of the CRI Movie library.
+ * This function must be successfully called before calling CriMvEasyPlayer::Create().
+ *
+ * In general, all CRI Movie APIs are available after calling CriMv::Initialize(), + * until CriMv::Finalize() is called. However, there are some methods that set options + * for the library as a whole which must be called before CriMv::Initialize():
+ *
+ * It is safe to call CriMv::Initialize() more than once, as long as your application calls + * CriMv::Finalize() once for each call to CriMv::Initialize(). Multiple calls will not + * have an effect on the library, other than to increment or decrement an internal counter. + * + * \sa CriMv::Finalize() + */ + /*JP + * \brief CRI Movieライブラリの初期化 + * \param err エラー情報(省略可) + * + * CRI Movie ライブラリを初期化します。
+ * CriMvEasyPlayer::Create 関数よりも先に呼び出してください。
+ *
+ * 原則として全ての CRI Movie ライブラリ関数は初期化後、終了関数呼び出しまでの間にのみ使用します。
+ * ただし、いくつかの設定関数は初期化関数よりも先に呼び出す必要があるものがあります。 + * 詳細は各設定関数の説明を参照してください。 + *
+ * 初期化関数を複数回呼び出した場合、2回目以降の呼び出しでは呼び出し回数を記録するだけで再初期化は行いません。
+ * この場合、正しく終了処理を行うには同じ回数だけ終了関数を呼び出す必要があります。 + * 初期化関数と終了関数は必ず対で呼び出すように実装してください。
+ * + * \sa CriMv::Finalize() + */ + void CRIAPI Initialize(CriError &err = CriMv::ErrorContainer); + + /* MEMO: + * If an application calls this function instead of CriMv::Initialize(), + * an application need to call CriMv::SetupMovieHandleWork() before CriMv::InitializeMana(). + */ + void CRIAPI InitializeMana(CriError &err = CriMv::ErrorContainer); + + /*EN + * \brief Initialize 32bit ARGB frame conversion + * + * This function initializes 32bit ARGB frame conversion.
+ * When an application uses CriMvEasyPlayer::GetFrameOnTimeAs32bitARGB(), + * please call this function after CriMv::Initialize().
+ * + * \sa CriMvEasyPlayer::GetFrameOnTimeAs32bitARGB() + */ + /*JP + * \brief 32bitARGB用フレーム変換の初期化 + * + * 32bitARGB用フレーム変換処理を初期化します。
+ * CriMvEasyPlayer::GetFrameOnTimeAs32bitARGB() を使用する場合は CRI Movie ライブラリの + * 初期化後に必ず呼び出してください。
+ * + * \sa CriMvEasyPlayer::GetFrameOnTimeAs32bitARGB() + */ + void CRIAPI InitializeFrame32bitARGB(void); + +#if defined(XPT_TGT_IPHONE) || defined(XPT_TGT_WINMO) || defined(XPT_TGT_ANDROID) || defined(XPT_TGT_CQSH2A) || defined(XPT_TGT_ACRODEA) || defined(XPT_TGT_NACL) || defined(XPT_TGT_SH7269) || defined(XPT_TGT_PC) || defined(XPT_TGT_TRGP6K) + void CRIAPI InitializeFrameRGB565(void); +#endif + + /*EN + * \brief De-initializes the CRI Movie library + * \param err Optional error code + * + * This function finalize whole CRI Movie library.
+ * An application needs to destroy all CriMvEasyPlayer handles and decoding threads before callign CriMv::Finalize().
+ *
+ * In principle, all CRI Movie library APIs are enabled after CriMv::Initialize() until CriMv::Finalize().
+ * But there are some APIs for parameter setting, which need to be called after CriMv::Finalize(). + * For details, refer to each explanations of setting APIs. + *
+ * \remarks + * CriMv::Finalize() must be called once for each call to CriMv::Initialize(). When the + * internal initialization count reaches 0, the library will be finalized. + * + * \sa CriMv::Initialize() + */ + /*JP + * \brief CRI Movieライブラリの終了 + * \param err エラー情報(省略可) + * + * CRI Movie ライブラリを終了します。
+ * この関数を呼び出す前に、全ての CriMvEasyPlayer ハンドルおよびデコードスレッドを破棄してください。
+ *
+ * 原則として全ての CRI Movie ライブラリ関数は初期化後、終了関数呼び出しまでの間にのみ使用します。
+ * ただし、いくつかの設定関数は終了関数よりも後に呼び出す必要があるものがあります。 + * 詳細は各設定関数の説明を参照してください。 + *
+ * 初期化関数を複数回呼び出した場合、正しく終了処理を行うには同じ回数だけ終了関数を呼び出す必要があります。 + * 初期化関数と終了関数は必ず対で呼び出すように実装してください。
+ * + * \sa CriMv::Initialize() + */ + void CRIAPI Finalize(CriError &err = CriMv::ErrorContainer); + +#if !defined(XPT_TGT_EE) + /*EN + * \brief Calculates the work buffer size needed for the given number of movie handles + * \param max_num Maximum number of movie handles desired + * \param err Optional error code + * \return The necessary work buffer size, in bytes + * + * Each active movie handle requires an internal work buffer. If your application + * needs to have multiple movies open at one time, it should determine how many handles + * it needs, allocate a buffer of the size returned by this function, and pass it to + * CriMv::SetupMovieHandleWork().
+ * + * Each CriMvEasy object uses a movie handle. Alpha movie playback uses two handles. + * If you need to play aplha movies, be sure to double the number of handles requested. + * + * \remarks + * The number of movie handles must be set before calling CriMv::Initialize(). + * + * \sa CriMv::SetupMovieHandleWork() + */ + /*JP + * \brief マルチハンドル用ワークバッファサイズの計算 + * \param max_num 最大ハンドル数(不透明ムービの再生時) + * \param err エラー情報(省略可) + * \return ワークサイズ + * + * 同時に使用する CriMvEasyPlayer ハンドルの最大数を増加させる場合に必要なワークバッファ + * サイズを計算します。 + * + * アルファムービを再生するとハンドル資源を2つ消費します。 + * もし複数のアルファムービ再生を行いたい場合は、最大ハンドル数は倍にして指定してください。 + * + * \sa CriMv::SetupMovieHandleWork() + */ + CriUint32 CRIAPI CalcMovieHandleWork(CriUint32 max_num, CriError &err = CriMv::ErrorContainer); + + /*EN + * \brief Increases the default number of available movie handles + * \param max_num Maximium number of movie handles + * \param workbuf Work buffer + * \param worksize Size of work buffer + * \param err Optional error code + * + * Call this function if your application needs to increase the maximum number of open movies + * beyond the default. Note that playing an alpha movie requires a second handle.
+ * + * The default number of movie handles depends on the platform.
+ * + * The work buffer must be allocated based on the size returned by CriMv::CalcMovieHandleWork().
+ * + * \remarks + * This function must be called before calling CriMv::Initialize(). + * + * \sa CriMv::CalcMovieHandleWork() + */ + /*JP + * \brief マルチハンドル用ワークバッファの設定 + * \param max_num 最大ハンドル数(不透明ムービの再生時) + * \param workbuf ワークバッファアドレス + * \param worksize ワークバッファサイズ + * \param err エラー情報(省略可) + * + * 同時に使用する CriMvEasyPlayer ハンドルの最大数を増加させるためのワークバッファを設定します。 + * なお、ワークバッファを指定しない場合のハンドル数上限は機種によって異なります。 + * + * ワークバッファの設定は、 CriMv::Initialize() の呼び出しに実行してください。 + * + * \sa CriMv::CalcMovieHandleWork() + */ + void CRIAPI SetupMovieHandleWork(CriUint32 max_num, void *workbuf, CriUint32 worksize, CriError &err = CriMv::ErrorContainer); + + /*EN + * \brief Get max number of movie handles + * \param err Optional error code + * \return Max number of movie handles you set by CriMv::SetupMovieHandleWork(). + * + * Returns the maximum number of movie handles that are available to CRI Movie.
+ * + * Note that this is not necessarily equal to the number of movies that can be + * opened at a time. In general, each movie will use one handle; however, + * alpha channel movies uses two handles. + * + * \sa CriMv::SetupMovieHandleWork(), CriMv::CalcMovieHandleWork() + */ + /*JP + * \brief 最大ハンドル数の取得 + * \param err エラー情報(省略可) + * \return CriMv::SetupMovieHandleWork() で設定した最大ハンドル数 + * + * CriMv::CalcMovieHandleWork() で最大ハンドル数を増加させた場合に、 + * 設定した最大ハンドル数を取得します。 + * + * \sa CriMv::SetupMovieHandleWork(), CriMv::CalcMovieHandleWork() + */ + CriUint32 CRIAPI GetMaxNumberOfHandles(CriError &err = CriMv::ErrorContainer); +#endif + + /* For Sofdec2 */ + CriSint32 CRIAPI CalcHandleWorkSize(CriMvHandleConfig *config, CriError &err = CriMv::ErrorContainer); + void CRIAPI SetDelayDestroySubmodules(CriBool sw); +} + +/*************************************************************************** + * CLASS + ***************************************************************************/ +/*EN + * \brief File Reading Interface Class for EasyPlayer + * \ingroup MDL_IF_READER + * \par + * You can implement your own streaming filesystem for movie playback by deriving + * from this class.
+ * + * Pass an instance of this subclass to CriMvEasyPlayer::Create().
+ * + * This class is designed for asynchronous operation. All functions are pure virtual. + * + * \sa CriMvEasyPlayer::Create() + */ +/*JP + * \brief ファイル読み込みインタフェース for EasyPlayer + * \ingroup MDL_IF_READER + * + * このクラスを定義することで、自前のファイルシステムを使ってEasyPlayerの + * ストリーミング再生が可能になります。
+ * 全ての関数は純粋仮想関数として定義されているので、全ての関数を必ず実装してください。 + * + * \sa CriMvEasyPlayer::Create() + */ +class CriMvFileReaderInterface +{ +public: + /*EN Status of an asynchronous operation */ + /*JP 非同期処理ステータス */ + enum AsyncStatus { + ASYNC_STATUS_STOP, /*EN< No action */ + /*JP< 何もしていない状態。*/ + ASYNC_STATUS_BUSY, /*EN< Currently processing */ + /*JP< 処理中 */ + ASYNC_STATUS_COMPLETE, /*EN< Processing completed */ + /*JP< 処理終了 */ + ASYNC_STATUS_ERROR, /*EN< An error occured */ + /*JP< エラー */ + + /* Keep enum 4bytes */ + ASYNC_STATUS_MAKE_ENUM_SINT32 = 0x7FFFFFFF + }; + /*EN Offset values for Seek() */ + /*JP シーク開始位置 */ + enum SeekOrigin { + SEEK_FROM_BEGIN, /*EN< Start of file */ + /*JP< ファイル先頭 */ + SEEK_FROM_CURRENT, /*EN< Current position in file */ + /*JP< ファイルの現在位置 */ + SEEK_FROM_END, /*EN< End of file */ + /*JP< ファイル終端 */ + + /* Keep enum 4bytes */ + SEEK_FROM_MAKE_ENUM_SINT32 = 0x7FFFFFFF + }; + /*EN + * \brief Opens a file asynchronously + * \param fname Name of file to open + * + * Initiates a file open request, and returns immediately. + * + * To determine success or failure, call CriMvFileReaderInterface::GetOpenStatus().
+ * + * \remarks + * CRI Movie may call CriMvFileReaderInterface::Read() and CriMvFileReaderInterface::Close() + * before CriMvFileReaderInterface::GetOpenStatus() returns ASYNC_STATUS_COMPLETE. + * + * \sa CriMvFileReaderInterface::GetOpenStatus() + */ + /*JP + * \brief ファイル名によるファイルオープン(即時復帰) + * \param fname ファイル名の文字列 + * + * ファイル名指定でファイルのオープン要求を出します。
+ * この関数は即時復帰の関数として呼び出されます。
+ * オープン処理が終わったかどうかは CriMvFileReaderInterface::GetOpenStatus関数 + * でチェックできるようにしてください。
+ * CRI Movie ライブラリはオープン処理が終わる(= CriMvFileReaderInterface::GetOpenStatus関数が + * ASYNC_STATUS_COMPLETEを返す)前に、リード、クローズの要求を呼び出す可能性があります。 + * + * \sa CriMvFileReaderInterface::GetOpenStatus() + */ + /* pure */ virtual void Open(CriChar8 *fname)=0; + + /*EN + * \brief Closes a file asynchronously + * + * Initiates a file close request, and returns immediately.
+ * + * To determine success or failure, call CriMvFileReaderInterface::GetCloseStatus().
+ * + * \sa CriMvFileReaderInterface::GetCloseStatus() + */ + /*JP + * \brief ファイルのクローズ(即時復帰) + * + * オープン済みのファイルのクローズ要求を出します。
+ * この関数は即時復帰の関数として呼び出されます。
+ * クローズ処理が終わったかどうかは CriMvFileReaderInterface::GetCloseStatus() + * でチェックできるようにしてください。 + * + * \sa CriMvFileReaderInterface::GetCloseStatus() + */ + /* pure */ virtual void Close(void)=0; + + /*EN + * \brief Reads from a file + * \param buffer Buffer to read into + * \param req_size Size of the buffer + * + * Initiates a file read request, and returns immediately.
+ * + * The buffer must be available and writable until the read request completes.
+ * + * To determine success or failure, call CriMvFileReaderInterface::GetReadStatus().
+ * + * To determine the number of bytes actually read, call CriMvFileReaderInterface::GetReadSize() + * after CriMvFileReaderInterface::GetReadStatus() has returned ASYNC_STATUS_COMPLETE. + * + * \remarks + * CRI Movie may call CriMvFileReaderInterface::Close() before + * CriMvFileReaderInterface::GetReadStatus() returns ASYNC_STATUS_COMPLETE. + * + * \sa CriMvFileReaderInterface::GetReadStatus(), CriMvFileReaderInterface::GetReadSize() + */ + /*JP + * \brief 読み込み要求(即時復帰) + * \param buffer 書き出しバッファのポインタ。読み込み要求サイズを満たすだけのバッファを確保しておく必要があります。 + * \param req_size 読み込み要求サイズ。単位はバイト単位です。 + * + * ファイルの読み込み要求を出します。
+ * この関数は即時復帰の関数として呼び出されます。
+ * リード処理が終わったかどうかは CriMvFileReaderInterface::GetReadStatus() + * でチェックできるようにしてください。
+ * CRI Movie ライブラリはリード処理が終わる(= CriMvFileReaderInterface::GetReadStatus()が + * ASYNC_STATUS_COMPLETEを返す)前に、クローズ要求を呼び出す可能性があります。
+ * この関数は読み込んだサイズを返しません。
+ * 読み込み済みサイズは、 CriMvFileReaderInterface::GetReadStatus()が ASYNC_STATUS_COMPLETEを + * 返したあとに CriMvFileReaderInterface::GetReadSize()で返すように実装してください。 + * + * \sa CriMvFileReaderInterface::GetReadStatus(), CriMvFileReaderInterface::GetReadSize() + */ + /* pure */ virtual void Read(CriUint8 *buffer, CriSint64 req_size)=0; + + /*EN + * \brief Gets asynchronous status of a call to CriMvFileReaderInterface::Open() + * + * \return Status of the call + * + * While the Open() call is in process, this will return ASYNC_STATUS_BUSY.
+ * If the call fails, this will return ASYNC_STATUS_ERROR.
+ * On success, this will return ASYNC_STATUS_COMPLETE.
+ * + * \sa CriMvFileReaderInterface::Open() + */ + /*JP + * \brief オープンコマンドの状態取得 + * \return オープンコマンドの処理状態。 + * + * CriMvFileReaderInterface::Open関数の処理状態を取得します。 + * + * \sa CriMvFileReaderInterface::Open() + */ + /* pure */ virtual CriMvFileReaderInterface::AsyncStatus GetOpenStatus(void)=0; + + /*EN + * \brief Gets asynchronous status of a call to CriMvFileReaderInterface::Close() + * + * \return Status of the call + * + * While the Close() call is in process, this will return ASYNC_STATUS_BUSY.
+ * If the call fails, this will return ASYNC_STATUS_ERROR.
+ * On success, this will return ASYNC_STATUS_COMPLETE.
+ * + * \sa CriMvFileReaderInterface::Close() + */ + /*JP + * \brief クローズコマンドの状態取得 + * \return クローズコマンドの処理状態。 + * + * CriMvFileReaderInterface::Close関数の処理状態を取得します。 + * + * \sa CriMvFileReaderInterface::Close() + */ + /* pure */ virtual CriMvFileReaderInterface::AsyncStatus GetCloseStatus(void)=0; + + /*EN + * \brief Gets asynchronous status of a call to CriMvFileReaderInterface::Read() + * + * \return Status of the call + * + * While the Read() call is in process, this will return ASYNC_STATUS_BUSY.
+ * If the call fails, this will return ASYNC_STATUS_ERROR.
+ * On success, this will return ASYNC_STATUS_COMPLETE.
+ * + * \sa CriMvFileReaderInterface::Read() + */ + /*JP + * \brief リードコマンドの状態取得 + * \return リードコマンドの処理状態。 + * + * CriMvFileReaderInterface::Read関数の処理状態を取得します。 + * + * \sa CriMvFileReaderInterface::Read() + */ + /* pure */ virtual CriMvFileReaderInterface::AsyncStatus GetReadStatus(void)=0; + + /*EN + * \brief Gets the number of bytes read by a successful call to CriMvFileReaderInterface::Read() + * + * \return Number of bytes read + * + * Once CriMvFileReaderInterface::GetReadStatus() returns ASYNC_STATUS_COMPLETE, this + * function can be called to determine the number of bytes read by + * CriMvFileReaderInterface::Read().
+ * + * If no call to Read() has been made, this function will return 0.
+ * + * If called multiple times after completing the read, the same value will be returned each time. + * + * \sa CriMvFileReaderInterface::Read(), CriMvFileReaderInterface::GetReadStatus() + */ + /*JP + * \brief 前回読み込み要求に対する読み込み完了サイズ + * \return 読み込み完了サイズ。単位はByte。 + * + * 前回の読み込み要求に対して読み込み完了したサイズを返します。 + * まだ読み込みが1度も要求されていない場合は0を返します。 + * 読み込み完了後に繰り返しこの関数が呼び出された場合は、すべて同じ値を返します。 + * + * \sa CriMvFileReaderInterface::Read(), CriMvFileReaderInterface::GetReadStatus() + */ + /* pure */ virtual CriSint64 GetReadSize(void)=0; + + /*EN + * \brief Seeks to a new position in the file + * + * \param size Number of bytes to seek relative to \a offset + * \param offset Starting position of seek + * \return The offset, in bytes, from the previous file position. + * + * If \a offset is SEEK_FROM_BEGIN, seeking will start from the beginning of the file.
+ * If \a offset is SEEK_FROM_CURRENT, seeking will start from the current file position.
+ * If \a offset is SEEK_FROM_END, seeking will start from the end of the file.
+ * + * \sa CriMvFileReaderInterface::SeekOrigin + */ + /*JP + * \brief シーク + * \param size シークサイズ + * \param offset シークの開始位置 + * \return 実際にシークした距離。Byte単位。 + * + * \sa CriMvFileReaderInterface::SeekOrigin + * + */ + /* pure */ virtual CriSint64 Seek(CriSint64 size, CriMvFileReaderInterface::SeekOrigin offset)=0; + + /*EN + * \brief Gets the file size + * + * \return File size, in bytes + * + * This function can safely be called once CriMvFileReaderInterface::Open() has completed + * successfully. + * + * \sa CriMvFileReaderInterface::Open(), CriMvFileReaderInterface::GetOpenStatus() + */ + /*JP + * \brief ファイルサイズの取得 + * \return ファイルサイズ[byte]. + * + * この関数はファイルオープンの終了後に呼び出されます。 + * + * \sa CriMvFileReaderInterface::Open(), CriMvFileReaderInterface::GetOpenStatus() + */ + /* pure */ virtual CriSint64 GetFileSize(void)=0; + +protected: + virtual ~CriMvFileReaderInterface(void) {} +}; + +/*EN + * \brief Sound Interface Class for EasyPlayer + * \ingroup MDL_IF_SOUND + * + * \par + * A class derived from CriMvSoundInterface is required in order to play sound in CRI Movie. + * Pass an instance of this subclass to CriMvEasyPlayer::Create().
+ * + * If you do not need audio output, you can pass NULL instead. However, if you do, + * you can not use a movie timer of type MVEASY_TIMER_AUDIO. See CriMvEasyPlayer::SetMasterTimer() + * for more details.
+ * + * Sound data must be provided in either 32 or 16 bit PCM format. + * + * All functions are pure virtual. + * + * \sa CriMvEasyPlayer::Create(), CriMvEasyPlayer::SetMasterTimer(), CriMvEasyPlayer::TimerType + */ +/*JP + * \brief サウンド出力インタフェース + * \ingroup MDL_IF_SOUND + * + * \sa CriMvEasyPlayer::Create(), CriMvEasyPlayer::SetMasterTimer(), CriMvEasyPlayer::TimerType + */ +class CriMvSoundInterface +{ +public: + /*EN + * \brief The status of the Sound Module + * + * This is the return value of CriMvSoundInterface::GetStatus().
+ * + * After CriMvSoundInterface::Start() is called, the state transitions to MVEASY_SOUND_STATUS_EXEC.
+ * While the state is MVEASY_SOUND_STATUS_EXEC, the sound module calls the callback function + * to retrieve sound data as needed.
+ * When the EasyPlayer is stopped, or transits to MVEASY_STATUS_PLAYEND, + * CRI Movie will call CriMvSoundInterface::Stop(). Then, CRI Movie waits for + * CriMvSoundInterface::GetStatus() to return MVEASY_SOUND_STATUS_STOP, + * and calls CriMvSoundInterface::DestroyOutput(). + * + * \sa CriMvSoundInterface::GetStatus(), CriMvSoundInterface::Start(), + * CriMvSoundInterface::Stop(), CriMvSoundInterface::DestroyOutput() + */ + /*JP + * \brief サウンドモジュールの状態 + * + * サウンドモジュールの状態を表す列挙型です。
+ * CriMvEasyPlayer::GetStatus() の関数値です。
+ * CriMvSoundInterface::Start() が呼び出されるとMVEASY_SOUND_STATUS_EXEC状態になります。
+ * MVEASY_SOUND_STATUS_EXEC状態の間は、サウンド出力モジュールはコールバック関数を呼び出します。
+ * CRI Movie ライブラリは再生終了または再生停止指示を受けた場合、まず CriMvSoundInterface::Stop()を呼び出します。
+ * その後、STOP状態になるのを待ってから CriMvSoundInterface::DestroyOutput()を呼び出します。 + * + * \sa CriMvSoundInterface::GetStatus(), CriMvSoundInterface::Start(), + * CriMvSoundInterface::Stop(), CriMvSoundInterface::DestroyOutput() + */ + enum Status { + MVEASY_SOUND_STATUS_STOP, /*EN< No sound processing is happening. */ + /*JP< CRI Movie のサウンド出力をしていない状態 */ + MVEASY_SOUND_STATUS_EXEC, /*EN< Sound data is being retrieved and processed. */ + /*JP< CRI Movie のサウンド出力中 */ + MVEASY_SOUND_STATUS_ERROR, /*EN< An error has occurred. */ + /*JP< エラー状態 */ + + /* Keep enum 4bytes */ + MVEASY_SOUND_STATUS_MAKE_ENUM_SINT32 = 0x7FFFFFFF + }; + + /*EN + * \brief PCM audio data format + * + * CRI Movie only operates on PCM encoded data. Two formats are supported: 32 bit floating + * point values, and 16 bit integer values. + * + * Return one of these values from CriMvSoundInterface::GetPcmFormat(). + * According to the returned format, CRI Movie calls a SetCallback for the specified PCM format. + * + * \sa CriMvSoundInterface::GetPcmFormat(), CriMvSoundInterface::SetCallbackGetFloat32PcmData(), + * CriMvSoundInterface::SetCallbackGetSint16PcmData() + */ + /*JP + * \brief PCMデータフォーマット + * + * PCMの出力フォーマットはPcmFormat型で定義されたいずれかでなければいけません。
+ * EasyPlayerは CriMvSoundInterface::GetPcmFormat()で取得できるデータ型のみ使用します。
+ * アプリケーションはこのクラスの全ての関数を実装しなければいけないので、使わないフォーマット + * のコールバック登録関数はカラ関数として実装してください。 + * + * \sa CriMvSoundInterface::GetPcmFormat(), CriMvSoundInterface::SetCallbackGetFloat32PcmData(), + * CriMvSoundInterface::SetCallbackGetSint16PcmData() + */ + enum PcmFormat { + MVEASY_PCM_FLOAT32, /*EN< PCM data is in 32 bit floating point format. */ + /*JP< 32bit 浮動小数型のPCMフォーマット */ + MVEASY_PCM_SINT16, /*EN< PCM data is in 16 bit integer format. */ + /*JP< 16bit 整数型のPCMフォーマット */ + + /* Keep enum 4bytes */ + MVEASY_PCM_MAKE_ENUM_SINT32 = 0x7FFFFFFF + }; + + /*EN + * \brief Creates a sound output module + * \param heap Handle to a CriHeap object + * \param channel Number of sound channels (1 = monaural, 2 = stereo, 6 = 5.1ch) + * \param samplerate Sample rate of audio data (ex. 48000 = 48k) + * \return TRUE if the sound module was created successfully + * \return FALSE if there was an error + * + * Creates a CRI Movie sound output module and prepares it for use. Memory for the module + * is taken from the provided CriHeap object.
+ * + * CRI Movie calls this method once it has determined that a movie has an active audio track + * and has analyzed the number of channels (mono, stereo, 5.1ch, etc.) and the sample rate. + * + */ + /*JP + * \brief サウンド出力の作成 + * \param heap メモリハンドル + * \param channel 出力するサウンドのチャネル数 (1=monaural, 2=stereo, 6=5.1ch) + * \param samplerate サンプリングレート (ex. 48k = 48000) + * \return 作成結果。成功の場合はTRUE、失敗の場合はFALSEが返ります。 + * + * サウンド出力を作成します。
+ * この関数は CRI Movie が再生するサウンドが決定したあとに、そのサウンドのチャネル数や + * サンプリングレートを引数として実行されます。 + * + */ + /* pure */ virtual CriBool CreateOutput(CriHeap heap, CriUint32 channel, CriUint32 samplerate)=0; + + /*EN + * \brief Destroys the sound output module + * + * Deletes the sound output module that was created by + * CriMvSoundInterface::CreateOutput().
+ * + * CRI Movie calls this method once CriMvSoundInterface::GetStatus() returns MVEASY_SOUND_STATUS_STOP. + * + */ + /*JP + * \brief サウンド出力の破棄 + * + * サウンド出力を破棄します。
+ * この関数はサウンド出力が MVEASY_SOUND_STATUS_STOP 状態になった後に呼び出されます。 + * + */ + /* pure */ virtual void DestroyOutput(void)=0; + + /*EN + * \brief Gets the PCM format of audio data + * \return The type of PCM format supported by this CriMvSoundInterface instance + * + * CRI Movie supports audio data in one of two PCM formats: 32 bit floating point (MVEASY_PCM_FLOAT32) + * or 16 bit integer (MVEASY_PCM_SINT16). EasyPlayer uses the return value from this method to + * determine which format is being used, and will call the appropriate callback function to retrieve + * data samples. + * + * \sa CriMvSoundInterface::PcmFormat + */ + /*JP + * \brief PCMデータフォーマットの取得 + * \return CriMvSoundInterface が使用するPCMフォーマットを返します。 + * + * EasyPlayerはこの関数によって、出力するPCMフォーマットを判断します。 + * + * \sa CriMvSoundInterface::PcmFormat + */ + /* pure */ virtual PcmFormat GetPcmFormat(void)=0; + + /*EN + * \brief Sets the callback function for retrieving 32 bit floating point PCM sound samples + * \param func Function that is called when CriMvSoundInterface gets PCM data (32bit float) + * \param obj Pointer to user-specifed data, passed as the first argument to the callback + * + * Sets a function that CriMvSoundInterface will call when it needs audio data in 32 bit floating point + * PCM format. This callback function takes 4 arguments:
+ * + * - \a obj: The user-specified \a obj parameter passed to SetCallbackGetFloat32PcmData().
+ * - \a nch: The number of audio channels. Mono is 1, stereo is 2, 5.1 channel is 6.
+ * - \a pcmbuf: An array of buffers to hold the returned PCM data. There must be one element of + * this array for each channel.
+ * - \a req_nsmpl: The number of samples requested. Each buffer must be large enough to hold this + * many samples (i.e. \a nch * \a req_nsmpl). + * + * \remarks + * The maximum number of channels is CRIMV_PCM_BUFFER_MAX + * + * \sa CriMvSoundInterface::SetCallbackGetSint16PcmData() + */ + /*JP + * \brief 32bit形式でPCMデータを取得するコールバック関数の登録 + * \param func CriMvSoundInterface がPCMデータを要求する際に呼びだすコールバック関数 + * \param obj コールバック関数を実行する際に第一引数に指定するオブジェクト変数 + * + * CriMvSoundInterface がEasyPlayerにPCMデータを要求する際に呼び出すコールバック関数を登録します。 + * コールバック関数は4つの引数を持っています。
+ * - "obj" はコールバック関数内で使用するオブジェクトです。 + * コールバック関数を呼び出す際は、関数登録時に指定されたobjを必ずこの引数に入れてください。
+ * - "nch" は CriMvSoundInterface が要求するオーディオのチャネル数です。モノラルなら1。ステレオなら2。5.1chなら6となります。
+ * - "pcmbuf" はPCMデータを格納するためのバッファポインタ配列です。
+ * バッファの実体は CriMvSoundInterface で準備してください。バッファの数は"nch"と同じでなければいけません。
+ * - "req_nsmpl" は CriMvSoundInterface が要求するPCMデータの最大サンプル数です。
+ * "pcmbuf"で指定した各バッファ実体には、このサンプル数が書き込まれても大丈夫なだけの領域を必ず準備してください。
+ * + * 登録されたコールバック関数を呼び出すタイミングは CriMvSoundInterface の任意となります。 + * + * \sa CriMvSoundInterface::SetCallbackGetSint16PcmData() + */ + /* pure */ virtual void SetCallbackGetFloat32PcmData(CriUint32 (*func)(void *obj, CriUint32 nch, CriFloat32 *pcmbuf[], CriUint32 req_nsmpl), void *obj)=0; + + /*EN + * \brief Sets the callback function for retrieving 16 bit integer PCM sound samples + * \param func Function that will be called when 16 bit integer PCM data is needed + * \param obj Pointer to user-specifed data, passed as the first argument to the callback + * + * Sets a function that CriMvSoundInterface will call when it needs audio data in 16 bit integer + * PCM format. This callback function takes 4 arguments:
+ * + * - \a obj: The user-specified \a obj parameter passed to SetCallbackGetSint16PcmData().
+ * - \a nch: The number of audio channels. Mono is 1, stereo is 2, 5.1 channel is 6.
+ * - \a pcmbuf: An array of buffers to hold the returned PCM data. There must be one element of + * this array for each channel.
+ * - \a req_nsmpl: The number of samples requested. Each buffer must be large enough to hold this + * many samples (i.e. \a nch * \a req_nsmpl). + * + * \remarks + * The maximum number of channels is CRIMV_PCM_BUFFER_MAX (currently 8) + * + * \sa CriMvSoundInterface::SetCallbackGetFloat32PcmData() + */ + /*JP + * \brief 16bit形式でPCMデータを取得するコールバック関数の登録 + * \param func CriMvSoundInterface がPCMデータを要求する際に呼びだすコールバック関数 + * \param obj コールバック関数を実行する際に第一引数に指定するオブジェクト変数 + * + * PCMフォーマットが違う以外は、 CriMvSoundInterface::SetCallbackGetFloat32PcmData() と同じです。 + * + * \sa CriMvSoundInterface::SetCallbackGetFloat32PcmData() + */ + /* pure */ virtual void SetCallbackGetSint16PcmData(CriUint32 (*func)(void *obj, CriUint32 nch, CriSint16 *pcmbuf[], CriUint32 req_nsmpl), void *obj)=0; + + /*EN + * \brief Starts sound output + * + * CRI Movie will call this method when it needs to start playing sound. The PCM data callback function + * has to be called after this function until movie playback is finished.
+ * + * Your sound module should begin incrementing its playback time when this method is called. + * + * \remarks + * On success, this should set the status to CriMvSoundInterface::MVEASY_SOUND_STATUS_EXEC. + */ + /*JP + * \brief サウンド出力の開始 + * + * サウンド出力を開始します。PCMデータ取得用コールバック関数は、本関数の呼出し後から実行してください。 + */ + /* pure */ virtual void Start(void)=0; + + /*EN + * \brief Stops sound output + * + * CRI Movie will call this when the movie playback stops, or the status changes to MVEASY_STATUS_PLAYEND.
+ * + * When EasyPlayer wants to pause and restart playback, it will call CriMvSoundInterface::Pause() + * instead of this method.
+ * + * Your sound module should set its playback time to 0 when this method is called. + * + * \remarks + * This should set the status to CriMvSoundInterface::MVEASY_SOUND_STATUS_STOP. + * + * \sa CriMvSoundInterface::Pause(), CriMvSoundInterface::Start() + */ + /*JP + * \brief サウンド出力の停止 + * + * サウンド出力を停止します。再開できるようにする必要はありません。
+ * EasyPlayerが再開処理を行いたい場合は、本関数ではなく、 CriMvSoundInterface::Pause()を呼び出します。
+ * CriMvSoundInterface::Stop() 呼出し後は、コルーバック関数を呼ばないように実装してください。 + * + * \sa CriMvSoundInterface::Pause(), CriMvSoundInterface::Stop() + */ + /* pure */ virtual void Stop(void)=0; + + /*EN + * \brief Gets status of sound module + * \return The module status + * + * This must return one of the enumerated values in CriMvSoundInterface::Status.
+ * + * While this method returns CriMvSoundInterface::MVEASY_SOUND_STATUS_EXEC, EasyPlayer will call the + * PCM data callback.
+ * When a movie has finished playing and this method returns CriMvSoundInterface::MVEASY_SOUND_STATUS_STOP, + * EasyPlayer will call CriMvSoundInterface::DestroyOutput(). + * + * \sa CriMvSoundInterface::Status + */ + /*JP + * \brief サウンドモジュールの状態取得 + * + * サウンドモジュールの状態を取得します。 + * + * \sa CriMvSoundInterface::Status + */ + /* pure */ virtual Status GetStatus(void)=0; + + /*EN + * \brief Pauses or resumes sound output + * \param sw Pause or resume playback. + * + * If \a sw is 1 (ON), output will be paused.
+ * If \a sw is 0 (OFF), output will be resumed.
+ * + * Temporarily pauses or resumes sound output.
+ * + * When you pause sound output, you must pause your playback timer as well. + */ + /*JP + * \brief サウンド出力の一時停止または再開 + * \param sw ポーズスイッチ。ポーズONの場合は1、ポーズOFF(レジューム)の場合は0を指定します。 + * + * 本関数の動作は引数に依存します。
+ * 引数 sw がON(1)なら、一時停止。引数 sw がOFF(0)ならサウンド出力再開です。 + */ + /* pure */ virtual void Pause(CriBool sw)=0; + + /*EN + * \brief Gets the time, in seconds, that sound has been playing + * \param count Playback time counter + * \param unit Counter increment per second + * + * CRI Movie calls this method periodically for some damn reason.
+ *
+ * The time, in seconds, is specified by \a count / \a unit.
+ * + * For example, if \a count was 500 and \a unit was 1000, that would be 0.5 seconds.
+ * + * \remarks + * Before Start() is called, and after Stop() is called, \a count should be 0. + */ + /*JP + * \brief 再生時刻の取得 + * \param count タイマカウント + * \param unit 1秒あたりのタイマカウント値。count ÷ unit で秒単位の時刻となります。 + * + * タイマ時刻を取得します。時刻はcountとunitの二つの変数で表現します。
+ * count ÷ unit で秒単位の時刻となるような値を返します。
+ * 再生開始前( CriMvSoundInterface::Start()呼び出し前)および + * 再生停止後( CriMvSoundInterface::Stop()呼び出し後)は、時刻0(タイマカウントが0)を返します。 + */ + /* pure */ virtual void GetTime(CriUint64 &count, CriUint64 &unit)=0; // sec = count / unit. + +protected: + virtual ~CriMvSoundInterface(void) {} +}; + +/*EN + * \brief System Timer Interface Class for EasyPlayer + * \ingroup MDL_IF_TIMER + * + * If you want to synchronize video frames with something other than the audio track, or if you + * need to play a movie that does not have an audio track, you will need to pass an instance of + * a class derived from CriMvSystemTimerInterface to CriMvEasyPlayer::Create().
+ * + * If you do not need any special timer facilities, you can pass NULL to CriMvEasyPlayer::Create() instead.
+ * + * All functions are pure virtual. + * + * \sa CriMvEasyPlayer::Create(), CriMvEasyPlayer::SyncMasterTimer() + */ +/*JP + * \brief システムタイマーインタフェース for EasyPlayer + * \ingroup MDL_IF_TIMER + * + * システムタイマーは音無しムービ再生時に、ビデオフレームの送出タイミングを調整するために使用されます。
+ * このクラスを定義することで、自前のタイマシステムを使ってEasyPlayerのストリーミング再生が可能になります。
+ * 全ての関数は純粋仮想関数として定義されているので、全ての関数を必ず実装してください。 + * + * \sa CriMvEasyPlayer::Create(), CriMvEasyPlayer::SyncMasterTimer() + */ +class CriMvSystemTimerInterface +{ +public: + /*EN + * \brief Starts timer and resets it to 0 + * + * When this method is called, your internal counter should initialize itself to 0 and start + * normal operation. + */ + /*JP + * \brief タイマ開始 + * + * タイマのカウントを開始します。この関数が呼ばれた時が時刻0となります。 + */ + /* pure */ virtual void Start(void)=0; + + /*EN + * \brief Stops the timer and resets it to 0 + * + * When this method is called, your internal counter should stop incrementing, and re-initialize + * itself to 0. After this method has been called, CriMvSystemTimerInterface::GetTime() must + * return a time of 0 seconds. + */ + /*JP + * \brief タイマ停止 + * + * タイマのカウントを停止します。この関数が呼ばれたあとに、そのタイマを再開することはありません。 + */ + /* pure */ virtual void Stop(void)=0; + + /*EN + * \brief Pauses or resumes the timer + * + * \param sw Pause or resume timer operation. + * + * If \a sw is 1 (ON), the timer will be paused.
+ * If \a sw is 0 (OFF), the timer will be resumed.
+ * + * Temporarily pauses or resumes the timer.
+ * + * When you pause the timer, you must maintain the previous value of the counter. + */ + /*JP + * \brief タイマの一時停止または再開 + * \param sw ポーズスイッチ。ON(1)なら一時停止、OFF(0)なら再開。 + * + * 本関数の動作は引数に依存します。
+ * 引数 sw がON(1)なら、一時停止。引数 sw がOFF(0)ならタイマカウント再開です。 + */ + /* pure */ virtual void Pause(CriBool sw)=0; + + /*EN + * \brief Gets the time, in seconds, that the timer has been running + * + * \param count Timer counter + * \param unit Counter increment per second + * + * CRI Movie calls this method periodically to synchronize video playback with the + * movie's internal framerate.
+ *
+ * The time, in seconds, is specified by \a count / \a unit.
+ * + * For example, if \a count was 500 and \a unit was 1000, that would be 0.5 seconds.
+ * + * \remarks + * Before Start() is called, and after Stop() is called, \a count should be 0. + */ + /*JP + * \brief 経過時刻の取得 + * \param count タイマカウント + * \param unit 1秒あたりのタイマカウント値。count ÷ unit で秒単位の時刻となります。 + * + * タイマ時刻を取得します。時刻はcountとunitの二つの変数で表現します。
+ * count ÷ unit で秒単位の時刻となるような値を返します。
+ * 再生開始前( CriMvSystemTimerInterface::Start()呼び出し前)および + * 再生停止後( CriMvSystemTimerInterface::Stop()呼び出し後)は、時刻0(タイマカウントが0)を返します。 + */ + /* pure */ virtual void GetTime(CriUint64 &count, CriUint64 &unit)=0; + +protected: + virtual ~CriMvSystemTimerInterface(void) {} +}; + + +/*EN + * \brief EasyPlayer Interface class for CRI Movie + * \ingroup MDL_EASY_PLAYER + */ +/*JP + * \brief EasyPlayerインタフェース + * \ingroup MDL_EASY_PLAYER + */ +class CriMvEasyPlayer : public CriAllocator +{ +public: + /*EN + * \brief The possible states an EasyPlayer handle can be in. + * + * An EasyPlayer handle takes on various states, depending on where it is in the decoding process. + * You can check the status of a valid EasyPlayer handle at any time by calling CriMvEasyPlayer::GetStatus(). + * + * An EasyPlayer handle is created in the MVEASY_STATUS_STOP state. During movie playback, the status + * transitions through various states from MVEASY_STATUS_STOP to MVEASY_STATUS_PLAYEND. + * + * An application does not need to check all states. At a minimum, it only needs to check for + * MVEASY_STATUS_STOP, MVEASY_STATUS_PLAYING, MVEASY_STATUS_PLAYEND, + * and MVEASY_STATUS_ERROR. + * + * If an application calls CriMvEasyPlayer::DecodeHeader(), the status of the EasyPlayer handle will change to + * MVEASY_STATUS_WAIT_PREP when CRI Movie has finished analyzing the movie information. The EasyPlayer + * handle will remain in this state until the application calls CriMvEasyPlayer::Prepare() or + * CriMvEasyPlayer::Start(). Once the state has changed to MVEASY_STATUS_WAIT_PREP, information + * about the movie can be retrieved by calling CriMvEasyPlayer::GetMovieInfo(). + * + * If an application calls CriMvEasyPlayer::Prepare(), the EasyPlayer handle status will change to + * MVEASY_STATUS_READY once CRI Movie has finished buffering enough input and decoded output for playback. + * The handle will remain in this state until CriMvEasyPlayer::Start() is called. This allows the application + * to better control playback timing, since a movie can immediately start playing. + * + * Once CriMvEasyPlayer::Start() is called and the movie is actively playing, the status will alternate + * between MVEASY_STATUS_PLAYING and MVEASY_STATUS_PREP, as CRI Movie plays back frames and decodes + * new ones. + * + * When the movie has finished playing normally, the status of the EasyPlayer handle will automatically change + * to MVEASY_STATUS_PLAYEND. If the movie is in looping mode, however, once the movie reaches the + * end, it will start playing from the beginning and the status will not change to MVEASY_STATUS_PLAYEND. + * + * When CriMvEasyPlayer::Stop() is called, the status of the handle will change to MVEASY_STATUS_STOP + * once it has finished any decoding and playback that is in progress. This does not happen immediately, + * but will take a few cycles. + * + * If there are any problems during playback, for instance insufficient memory or invalid input data, the + * status will change to MVEASY_STATUS_ERROR. When the handle is in state MVEASY_STATUS_ERROR, + * the application must call CriMvEasyPlayer::Stop() and wait until the state changes to MVEASY_STATUS_STOP + * before doing anything else with the handle. + * + * Once the state is MVEASY_STATUS_STOP or MVEASY_STATUS_PLAYEND, the handle can be deleted by + * calling CriMvEasyPlayer::Destroy(). + * + * \attention + * As of CRI Movie version 2.00, the handling of the MVEASY_STATUS_ERROR state has changed. Previously, + * a handle could be destroyed when it was in the MVEASY_STATUS_ERROR state. Now, an application + * must call CriMvEasyPlayer::Stop() and wait for the MVEASY_STATUS_STOP state before destroying + * the handle. + * + * \sa CriMvEasyPlayer::GetStatus(), CriMvEasyPlayer::Start(), CriMvEasyPlayer::DecodeHeader(), + * CriMvEasyPlayer::Prepare(), CriMvEasyPlayer::GetMovieInfo(), CriMvEasyPlayer::Stop(), + * CriMvEasyPlayer::Destroy() + */ + /*JP + * \brief EasyPlayerハンドル状態 + * + * EasyPlayer のハンドル状態です。 + * ハンドル状態は CriMvEasyPlayer::GetStatus() でいつでも取得することが出来ます。
+ * ハンドル作成直後は MVEASY_STATUS_STOP 状態です。 + * + * ハンドル状態は MVEASY_STATUS_STOP から MVEASY_STATUS_PLAYEND まで順に遷移していきます。
+ * アプリケーションがムービを再生するにあたって、必ずしもこの全ての状態をチェックする必要はありません。
+ * 最低限、MVEASY_STATUS_STOP, MVEASY_STATUS_PLAYING, MVEASY_STATUS_PLAYEND, MVEASY_STATUS_ERROR さえ + * チェックすれば、ムービの再生を行うことができます。 + * + * EasyPlayer ハンドル作成後、ムービの解像度などが既に確定している場合は、アプリケーションは + * CriMvEasyPlayer::Start() を直接呼び出すことができます。この場合、ハンドル状態は自動的に + * MVEASY_STATUS_PLAYEND まで遷移していきます。 + * + * 最初に CriMvEasyPlayer::DecodeHeader() を呼び出した場合は、ヘッダ解析が終了するとハンドル状態は + * MVEASY_STATUS_WAIT_PREP となり、アプリケーションから CriMvEasyPlayer::Prepare() または + * CriMvEasyPlayer::Start() が呼ばれるまで待機します。 + * + * MVEASY_STATUS_WAIT_PREP状態以降、 CriMvEasyPlayer::GetMovieInfo() でムービ情報を取得することができます。
+ * CriMvEasyPlayer::Prepare() を呼び出した場合は、ヘッダ解析およびデータのバッファリングが終わると、 + * ハンドル状態は MVEASY_STATUS_READY となり、アプリケーションから CriMvEasyPlayer::Start() が + * 呼ばれるまで待機します。これによって再生開始のタイミングを調整することができます。 + * + * 再生が終了すると自動的に MVEASY_STATUS_PLAYEND になります。 + * + * CriMvEasyPlayer::Stop() を呼び出した場合は、デコーダの停止処理が終わったあとに MVEASY_STATUS_STOP + * 状態になります。 CriMvEasyPlayer::Stop() 終了直後に停止状態になるとは限りません。 + * + * メモリ不足やデータエラーなど何らかの問題が発生した場合は MVEASY_STATUS_ERROR 状態となります。
+ * MVEASY_STATUS_ERROR 状態になった場合は CriMvEasyPlayer::Stop() を呼び出してハンドル状態が + * MVEASY_STATUS_STOP 状態に遷移させてください。
+ * + * CriMvEasyPlayer::Destroy() は MVEASY_STATUS_STOP, MVEASY_STATUS_PLAYEND の + * いずれかの状態の時のみ呼び出すことができます。 + * + * \attention + * CRI Movie Ver.2.00 で MVEASY_STATUS_ERROR 状態についての仕様が変更になりました。
+ * MVEASY_STATUS_ERROR 状態でハンドル破棄が出来なくなり、 CriMvEasyPlay::Stop() を呼び出す必要があります。 + * + * \sa CriMvEasyPlayer::GetStatus(), CriMvEasyPlayer::Start(), CriMvEasyPlayer::DecodeHeader(), + * CriMvEasyPlayer::Prepare(), CriMvEasyPlayer::GetMovieInfo(), CriMvEasyPlayer::Stop(), + * CriMvEasyPlayer::Destroy() + */ + enum Status { + MVEASY_STATUS_STOP, /*EN< Standstill. No processing is happening. + * EasyPlayer handles are created in this state. */ + /*JP< 停止中 */ + MVEASY_STATUS_DECHDR, /*EN< The EasyPlayer handle is now parsing the movie header, + * including information about the width and height of the video stream. */ + /*JP< ヘッダ解析中 */ + MVEASY_STATUS_WAIT_PREP, /*EN< The EasyPlayer handle is a waiting for the work buffer to be allocated. */ + /*JP< バッファリング開始待機中 */ + MVEASY_STATUS_PREP, /*EN< The EasyPlayer handle is now buffering video and audio data. */ + /*JP< 再生準備中 */ + MVEASY_STATUS_READY, /*EN< Ready to start playback. */ + /*JP< 再生待機 */ + MVEASY_STATUS_PLAYING, /*EN< The decoders are currently decoding and playing output. */ + /*JP< 再生中 */ + MVEASY_STATUS_PLAYEND, /*EN< The end of the movie has been reached. */ + /*JP< 再生終了 */ + MVEASY_STATUS_ERROR, /*EN< An error has occurred. */ + /*JP< エラー */ + + /* Keep enum 4bytes */ + MVEASY_STATUS_MAKE_ENUM_SINT32 = 0x7FFFFFFF + }; + + /*EN + * \brief Supported timer types; used to synchronize video frames. + */ + /*JP + * \brief タイマ種別 + */ + enum TimerType { + MVEASY_TIMER_NONE, /*EN< No synchronization. The output is available as soon as + * each frame is decoded. */ + /*JP< ビデオフレームは時刻同期をしません。デコードが終わったフレーム + * はすぐに取得することができます。 */ + MVEASY_TIMER_SYSTEM, /*EN< Video frames synchronize to the system timer.
+ * You must provide an instance of CriMvSystemTimerInterface to + * CriMvEasyPlayer::Create(). */ + /*JP< ビデオフレームはシステム時刻に同期します。システム時刻はアプリケーション + * が CriMvSystemTimerInterface としてCriMvEasyハンドルに設定する必要があります。 */ + MVEASY_TIMER_AUDIO, /*EN< Video frames synchronize with the movie's audio data.
+ * You must provide an instance of CriMvSoundInterface to CriMvEasyPlayer::Create().
+ * If the movie does not have audio, video frames will synchronize with the system timer. */ + /*JP< ビデオフレームはムービのオーディオ時刻に同期します。 + * アプリケーションは GetTime関数を含む CriMvSoundInterface をCriMvEasy + * ハンドルに設定する必要があります。もしもムービデータにオーディオが含まれて + * いない場合は、ビデオはシステム時刻に同期します。 */ + + /* Keep enum 4bytes */ + MVEASY_TIMER_MAKE_ENUM_SINT32 = 0x7FFFFFFF + }; + + /*EN + * \ingroup MODULE_INIT + * + * \brief Creates an EasyPlayer handle + * + * \param heap Handle to a CriHeap object + * \param freader File input interface + * \param stimer System timer interface + * \param sound Sound module interface + * \param err Optional error code + * + * \return A valid CriMvEasyPlayer handle, or NULL if the handle cannot be allocated + * + * Creates and initialize a new EasyPlayer handle. Its status is initially MVEASY_STATUS_STOP. + * Memory for the handle is allocated from the provided CriHeap object. + * + * If memory allocation fails, this function will return NULL. Be sure to initialize and create + * your heap with criHeap_Initialize() and criHeap_Create() before calling this function. + * + * \remarks + * CriMv::Initialize() must be called before calling this function. + * + */ + /*JP + * \ingroup MODULE_INIT + * \brief EasyPlayerハンドルの作成 + * \param heap CriHeapハンドル + * \param freader ファイル読み込みインタフェース + * \param stimer システムタイマインタフェース + * \param sound サウンドインタフェース + * \param err エラー情報 + * \return CriMvEasyハンドルを返します。エラーが発生した場合は、NULLを返します。 + * + * 本関数は CriMv::Initialize() 呼び出しよりもに実行してください。
+ * ハンドル作成後はハンドル状態はMVEASY_STATUS_STOPとなります。
+ * ハンドル確保に必要なメモリは全て、引数で渡された CriHeap を使って確保されます。
+ * メモリ不足などでエラーが発生した場合は、本関数はNULLを返します。 + * + */ + static CriMvEasyPlayer* CRIAPI Create(CriHeap heap, + CriMvFileReaderInterface *freader, + CriMvSystemTimerInterface *stimer, + CriMvSoundInterface *sound, + CriError &err=CriMv::ErrorContainer); + /*EN + * \ingroup MODULE_INIT + * \brief Destroy a handle + * \param err Optional error code + * + * \ingroup MODULE_INIT + * + * \brief Destroys an EasyPlayer handle + * \param err Optional error code + * + * Destroys an EasyPlayer handle previously created with CriMvEasyPlayer::Create(), and frees its resources. + * + * An EasyPlayer handle can only be destroyed when it is in the MVEASY_STATUS_STOP or MVEASY_STATUS_PLAYEND state. + * Attempting to destroy a handle when it is in any other state will cause an error. + * + * Any work buffers allocated via CriHeap, if still associated with the handle, are freed by this call. + * + * \sa CriMvEasyPlayer::Create(), CriMvEasyPlayer::Status, CriMvEasyPlayer::GetStatus() + */ + /*JP + * \ingroup MODULE_INIT + * \brief EasyPlayerハンドルの破棄 + * \param err エラー情報(省略可) + * + * CriMvEasyPlayer::Create()で作成したEasyPlayerハンドルを破棄します。 + * + * ハンドル状態が MVEASY_STATUS_STOP 、 MVEASY_STATUS_PLAYEND の時にのみハンドルを破棄することができます。
+ * それ以外の状態で呼び出した場合は、エラーになります。
+ * + * ハンドル状態が MVEASY_STATUS_ERROR だった場合は、CriMvEasyPlayer::Stop() を呼び出して + * MVEASY_STATUS_STOP 状態になってからハンドル破棄してください。
+ * ハンドル状態は CriMvEasyPlayer::GetStatus() で確認することができます。 + * + * ハンドル作成時に指定したCriHeapによって確保されたメモリで未解放の全ては、 + * この関数の呼び出しによって解放されます。 + * + * \sa CriMvEasyPlayer::Create(), CriMvEasyPlayer::Status, CriMvEasyPlayer::GetStatus() + */ + void Destroy(CriError &err=CriMv::ErrorContainer); + + /*EN + * \ingroup MODULE_BASIC + * + * \brief Returns status of an EasyPlayer handle. + * \param err Optional error code + * \return Handle status + * + * Returns the current status of an EasyPlayer handle. The status will be one of the values + * defined by CriMvEasyPlayer::Status. + * + * \sa CriMvEasyPlayer::Status + */ + /*JP + * \ingroup MODULE_BASIC + * \brief ハンドル状態の取得 + * \param err エラー情報(省略可) + * \return ハンドル状態 CriMvEasyPlayer::Status + * + * ハンドル状態を取得します。 + * + * \sa CriMvEasyPlayer::Status + */ + Status GetStatus(CriError &err=CriMv::ErrorContainer); + + /*EN + * \ingroup MODULE_BASIC + * + * \brief Executes heatbeat functions for an EasyPlayer handle + * \param err Optional error code + * + * Performs regular processing for an EasyPlayer handle, including handoff and parsing of input + * buffers, and audio decoding. Additionally, it checks for situations where the handle state + * should change to one of the values defined by CriMvEasyPlayer::Status, and changes state as + * necessary. + * + * This function and CriMvEasyPlayer::ExecuteDecode() should be called periodically during movie + * playback or when waiting for CriMvEasyPlayer::DecodeHeader() to complete. It takes a relatively + * low CPU load, and should typically be called on every vertical blank. + * + * \remarks + * Note that this function does not perform any video decoding. Decoding is done in + * CriMvEasyPlayer::ExecuteDecode(). + * + * \sa CriMvEasyPlayer::Status, CriMvEasyPlayer::ExecuteDecode(), CriMvEasyPlayer::DecodeHeader() + */ + /*JP + * \ingroup MODULE_BASIC + * \brief EasyPlayerサーバ関数 + * \param err エラー情報(省略可) + * + * ムービのヘッダ解析や入力バッファ制御、オーディオデコード等を行います。
+ * EasyPlayer ハンドルの状態遷移もこの関数で行います。
+ * この関数はビデオのデコードは行いません。そのためCPU負荷はあまり高くなりません。
+ * 本関数はアプリケーションのメインループで毎回呼び出すようにしてください。 + * + * \sa CriMvEasyPlayer::Status + */ + void Update(CriError &err=CriMv::ErrorContainer); + + /*EN + * \ingroup MODULE_BASIC + * + * \brief Synchronizes the master timer of an EasyPlayer handle. + * \param err Optional error code + * + * Synchronizes the timing of video frames to the master timer used by this EasyPlayer handle. + * If the master timer is of type MVEASY_TIMER_AUDIO and the movie does not have audio, + * EasyPlayer will use the system timer that was set when the handle was created. + * + * \sa CriMvEasyPlayer::TimerType, CriMvEasyPlayer::SetMasterTimer(), CriMvSystemTimerInterface + */ + /*JP + * \ingroup MODULE_BASIC + * \brief マスタタイマへの同期 + * \param err エラー情報(省略可) + * + * ムービ再生時刻をマスタタイマに同期させます。
+ * マスタタイマは CriMvEasyPlayer::SetMasterTimer() によって指定されたタイマを使います。
+ * タイマ種別として MVEASY_TIMER_AUDIO が指定されていて、再生するムービにオーディオが + * 含まれていない場合は、ハンドル作成時のシステムタイマを使用します。 + * + * この関数は、ハンドル作成時に指定したシステムタイマインタフェースの + * CriMvSystemTimerInterface::GetTime() を呼び出します。 + * + * \sa CriMvEasyPlayer::TimerType, CriMvEasyPlayer::SetMasterTimer(), CriMvSystemTimerInterface + */ + void SyncMasterTimer(CriError &err=CriMv::ErrorContainer); + + /*EN + * \ingroup MODULE_BASIC + * + * \brief Decodes a video frame + * \param err Optional error code + * \return \a TRUE If the movie is currently in a playback state + * \return \a FALSE If the movie is not playing + * + * Performs the actual video decoding. Each call to this function decodes a single frame. + * It does not return until the frame has been decoded. + * + * Video decoding can impose a very heavy CPU load, so calling this function from an application's + * main thread may cause your application to miss the vertical blank interval. To avoid this situation, + * ExecuteDecode() can be called from a separate, lower-priority thread. See the Mutithreaded Decoding + * tutorial for a full explanation. + * + * The return value describes the movie playback state. If TRUE, the movie is currently playing + * (or decoding the movie header) or ready to play. If FALSE, playback has not yet been started, + * or playback has finished. + * + * If a decoding thread is used, an application must wait until this function returns FALSE before destroying + * the thread. Otherwise, the handle state will not transition to MVEASY_STATUS_STOP or MVEASY_STATUS_PLAYEND, + * and the EasyPlayer handle cannot be destroyed. + * + * \attention + * ExecuteDecode() is the only CRI Movie function that is safe to call from a separate thread. + * No other CRI Movie functions should be considered to be thead-safe. + * + */ + /*JP + * \ingroup MODULE_BASIC + * \brief ビデオデコード + * \param err エラー情報(省略可) + * \return ムービ再生中はTRUE 、再生終了また停止後はFALSEを返します。 + * + * ビデオデータのデコードを行います。
+ * 本関数は1ピクチャ分のデコードを終わるまで終了しません。
+ * ピクチャデコードは負荷の高い処理なので、アプリケーションのメインスレッドから呼び出すと処理落ちが発生する可能性があります。
+ * その場合は、メインスレッドよりも優先度の低い別スレッドから呼び出すようにしてください。 + * + * 本関数の返り値は、ムービ再生の実行中かどうかを表しています。
+ * デコード用スレッドを終了する場合は、返り値がFALSEになるのを待たなければいけません。
+ * 返り値がTRUEの間にデコードスレッドを終了してしまうと、ハンドルの状態が MVEASY_STATUS_STOP や + * MVEASY_STATUS_PLAYEND に遷移できず、ハンドル破棄が出来なくなります。
+ * + */ + CriBool ExecuteDecode(CriError &err=CriMv::ErrorContainer); + + /* 再生制御 */ + /*EN + * \ingroup MODULE_CONTROL + * + * \brief Sets the name of the movie file to play + * \param fname Name of the movie file + * \param err Optional error code + * + * Sets the name of the movie file to play, but does not open the file. The length of the filename + * (including path) is limited to CRIMV_MAX_FILE_NAME characters. EasyPlayer copies this + * string to internal memory, so a temporary variable can be used. + * + * If an application plays the same movie repeatedly, it only needs to call this function once. + * + * Multiple calls to this function will overwrite previous values. Calling CriMvEasyPlayer::SetData() + * will clear any filename set by this function. + * + * \remarks + * This function can only be called when the handle status is MVEASY_STATUS_STOP or MVEASY_STATUS_PLAYEND, + * or from the file request callback. See CriMvEasyPlayer::SetFileRequestCallback() for details. + * + * \remarks + * Calling this function does not open the file. The file is opened by a call to CriMvEasyPlayer::Update(). + * + * \sa CriMvEasyPlayer::SetFileRequestCallback(), CriMvEasyPlayer::SetData() + */ + /*JP + * \ingroup MODULE_CONTROL + * + * \brief 再生ファイルの指定 + * \param fname ムービファイルパス + * \param err エラー情報(省略可) + * + * 再生するムービのファイルパスを設定します。ファイルパスの最大長は CRIMV_MAX_FILE_NAME バイトです。
+ * EasyPlayerは内部でこのファイルパスをコピーするので、引数で渡した文字列は破棄してもかまいません。 + * + * 同じファイルを繰り返し再生する場合は、この関数を再度呼び出す必要はありません。 + * + * この関数を呼び出した直後にもう一度この関数を呼び出すと、前回のファイル情報は新しいファイル情報に上書きされます。 + * CriMvEasyPlayer::SetData()関数を呼び出した場合は、事前に設定したファイル情報がクリアされます。 + * + * \para 備考1: + * この関数はハンドル状態が MVEASY_STATUS_STOP もしくは MVEASY_STATUS_PLAYEND時のみ呼び出し可能です。 + * またはファイル要求コールバック関数内でもこの関数を呼び出すことができます。詳細は CriMvEasyPlayer::SetFileRequestCallback()関数を + * 参照してください。 + * + * \para 備考2: + * この関数の内部ではファイルのオープン要求はしません。ファイルのオープン処理は CriMvEasyPlayer::Update() 関数の中で行われます。 + * + * \sa CriMvEasyPlayer::SetFileRequestCallback(), CriMvEasyPlayer::SetData(), CriMvEasyPlayer::SetFileRange() + */ + void SetFile(CriChar8 *fname, CriError &err=CriMv::ErrorContainer); + + /*EN + * \ingroup MODULE_CONTROL + * + * \brief Sets in-memory movie data + * \param dataptr Pointer to movie data + * \param datasize Size of data, in bytes + * \param err Optional error code + * + * Sets the in-memory data buffer for this EasyPlayer handle to point to the provided buffer, + * but does not attempt to read that buffer. After this call, the memory pointed to by \a dataptr + * belongs to CRI Movie and must remain valid until playback is complete. + * + * If an application plays the same movie data repeatedly, it only needs to call this function once. + * + * Multiple calls to this function will overwrite previous values. Calling CriMvEasyPlayer::SetFile() + * will clear any pointer set by this function. + * + * \remarks + * This function can only be called when the handle status is MVEASY_STATUS_STOP or MVEASY_STATUS_PLAYEND, + * or from the file request callback. See CriMvEasyPlayer::SetFileRequestCallback() for details. + * + * \remarks + * Calling this function does not attempt to reference the memory. The memory read is initiated by a call + * to CriMvEasyPlayer::DecodeHeader(), CriMvEasyPlayer::Prepare() or CriMvEasyPlayer::Start(). + * + * \sa CriMvEasyPlayer::SetFileRequestCallback(), CriMvEasyPlayer::SetFile(), CriMvEasyPlayer::SetFileRange() + */ + /*JP + * \ingroup MODULE_CONTROL + * \brief メモリ上データの指定 + * \param dataptr データポインタ + * \param datasize データサイズ + * \param err エラー情報(省略可) + * + * この関数はEasyPlayerのハンドル状態がMVEASY_STATUS_STOPかMVEASY_STATUS_PLAYENDの時に呼び出してください。
+ * または、ファイル要求コールバックの内部で呼び出すことができます。
+ * + * 本関数を繰り返し呼び出した場合は、メモリ情報は上書きされます。
+ * CriMvEasyPlayer::SetFile()を呼び出した場合は、本関数で指定したメモリ情報はハンドル内から消去されます。 + * + * 同じハンドルで同じムービデータを繰り返し再生する場合は、本関数の呼び出しは省略することができます。 + * + * 指定されたメモリ領域に実際にアクセスするのは、 CriMvEasyPlayer::DecodeHeader(), CriMvEasyPlayer::Prepare(), + * CriMvEasyPlayer::Start() のいずれかが呼び出された時以降です。
+ * + * \sa CriMvEasyPlayer::SetFileRequestCallback(), CriMvEasyPlayer::SetFile(), CriMvEasyPlayer::SetFileRange() + */ + void SetData(CriUint8 *dataptr, CriUint32 datasize, CriError &err=CriMv::ErrorContainer); + + /*EN + * \ingroup MODULE_CONTROL + * \brief Set a pack file and pass offset and range of movie file to an EasyPlayer handle + * \param fname File name string pointer of the pack file + * \param offset offset in byte to movie data in the packing file [in bytes] + * \param range size of movie data from the offset in the packing file [in bytes] + * \param err Optional error code + * + * Sets the name of the pack file that contains the movie file to play. + * EasyPlayer tries to read data from 'offset' through 'range' in the pack file as the movie data. + * Passing a negative value as range, EasyPlayer reads data until the end of the pack file. + * + * The length of file name is limited until CRIMV_MAX_FILE_NAME. + * EasyPlayer handle copies the file name string into the handle. + * You can use a temporary variable as the file name string. + * + * If an application plays the same movie repeatedly, it only needs to call this function once. + * + * Multiple calls to this function will overwrite previous values. Calling CriMvEasyPlayer::SetData() + * will clear any filename set by this function. + * + * \remarks + * This function can only be called when the handle status is MVEASY_STATUS_STOP or MVEASY_STATUS_PLAYEND, + * or from the file request callback. See CriMvEasyPlayer::SetFileRequestCallback() for details. + * + * \remarks + * Calling this function does not open the file. The file is opened by a call to CriMvEasyPlayer::Update(). + * + * \sa CriMvEasyPlayer::SetFileRequestCallback(), CriMvEasyPlayer::SetData(), CriMvEasyPlayer::SetFile() + */ + /*JP + * \ingroup MODULE_CONTROL + * + * \brief 再生したいムービファイルを含むパックファイルの指定 + * \param fname パックファイル名 (パスを含む) + * \param offset パックファイル内のムービデータまでのオフセット (単位: バイト) + * \param range パックファイル内のムービデータのサイズ (単位:バイト) + * \param err エラー情報(省略可) + * + * 再生するムービを含むパックファイルを指定します。引数で指定した offset 位置から range サイズ分までをパックファイル内に含まれるムービデータみなします。 + * rangeに負値を入力するとパックファイルの終端までをムービとして読み込みます。 + * + * パックファイルのファイルパスの最大長は CRIMV_MAX_FILE_NAME バイトです。 + * EasyPlayerは内部でこのファイルパスをコピーするので、引数で渡した文字列は破棄してもかまいません。 + * + * 同じファイルを繰り返し再生する場合は、この関数を再度呼び出す必要はありません。 + * + * この関数を呼び出した直後に、もう一度この関数を呼び出すと、前回のファイル情報は新しいファイル情報に上書きされます。 + * CriMvEasyPlayer::SetData()関数を呼び出した場合は、事前に設定したファイル情報がクリアされます。 + * + * \para 備考1: + * この関数はハンドル状態が MVEASY_STATUS_STOP もしくは MVEASY_STATUS_PLAYEND時のみ呼び出し可能です。 + * またはファイル要求コールバック関数内でもこの関数を呼び出すことができます。詳細は CriMvEasyPlayer::SetFileRequestCallback()関数を + * 参照してください。 + * + * \para 備考2: + * この関数の内部ではファイルのオープン要求はしません。ファイルのオープン処理は CriMvEasyPlayer::Update() 関数の中で行われます。 + * + * \sa CriMvEasyPlayer::SetFileRequestCallback(), CriMvEasyPlayer::SetData(), CriMvEasyPlayer::SetFile() + */ + void SetFileRange(CriChar8 *fname, CriUint64 offset, CriSint64 range, CriError &err=CriMv::ErrorContainer); + + /* 前回のムービデータをもう一度登録する(ファイル要求コールバック関数でのみ呼ぶこと) */ + void SetPreviousDataAgain(CriError &err=CriMv::ErrorContainer); + + /*EN + * \ingroup MODULE_CONTROL + * + * \brief Reads movie header and analyzes movie information + * \param err Optional error code + * + * This function opens the movie file, reads the header, and starts to analyze the movie data. + * It does not start movie playback. + * + * When this function is called, the handle status changes to MVEASY_STATUS_DECHDR. Once EasyPlayer + * has finished reading the header and analyzing the movie, the status changes to MVEASY_STATUS_WAIT_PREP. + * When the status is MVEASY_STATUS_WAIT_PREP, CriMvEasyPlayer::GetMovieInfo() can be successfully called. + * + * To continue playback, call CriMvEasyPlayer::Prepare() or CriMvEasyPlayer::Start() when the handle status + * is MVEASY_STATUS_WAIT_PREP. + * + * \remarks + * This function can only be called when the handle status is MVEASY_STATUS_STOP or MVEASY_STATUS_PLAYEND. + * + * \remarks + * You must either call CriMvEasyPlayer::SetFile() or CriMvEasyPlayer::SetData(), or provide a file request + * callback with CriMvEasyPlayer::SetFileRequestCallback(), before calling this function. + * + * \remarks + * Once this function has been called, CriMvEasyPlayer::ExecuteDecode() and CriMvEasyPlayer::Update() must be + * called periodically in order for this function to have any effect. Otherwise, the handle status will + * never change. + * + * \sa CriMvEasyPlayer::GetStatus(), CriMvEasyPlayer::Prepare(), CriMvEasyPlayer::Start(), + * CriMvEasyPlayer::SetFileRequestCallback(), + * CriMvEasyPlayer::ExecuteDecode(), CriMvEasyPlayer::Update() + */ + /*JP + * \ingroup MODULE_CONTROL + * \brief ムービヘッダ解析 + * \param err エラー情報(省略可) + * + * ムービの再生は開始せず、ヘッダ解析のみ行って待機するための関数です。
+ * この関数を使用してヘッダ解析を事前に済ませることにより、再生開始前にムービの解像度やオーディオの情報を + * 得ることができます。
+ * 本関数を呼び出すと、EasyPlayerのハンドル状態はMVEASY_STATUS_STOP → MVEASY_STATUS_DECHDR と遷移していき、 + * ヘッダ解析が完了するとMVEASY_STATUS_WAIT_PREPとなります。
+ * ムービ情報を取得するには、ハンドル状態がMVEASY_STATUS_WAIT_PREPになったあとに CriMvEasyPlayer::GetMovieInfo() + * を実行してください。
+ * + * ハンドル状態がMVEASY_STATUS_WAIT_PREPの時に、 CriMvEasyPlayer::Prepare() か CriMvEasyPlayer::Start() を + * 呼ぶことで再生処理を続けることができます。
+ * + * 本関数は EasyPlayerのハンドル状態がMVEASY_STATUS_STOPかMVEASY_STATUS_PLAYENDの時に呼び出してください。 + * + * 本関数を呼び出す前に CriMvEasyPlayer::SetFile() か CriMvEasyPlayer::SetData() でムービデータを指定してください。
+ * ただし、ファイル要求コールバック関数を登録している場合は事前のムービデータ設定は省略することだきます。 + * + * \sa CriMvEasyPlayer::GetStatus(), CriMvEasyPlayer::Prepare(), CriMvEasyPlayer::Start(), CriMvEasyPlayer::SetFileRequestCallback() + */ + void DecodeHeader(CriError &err=CriMv::ErrorContainer); + + /*EN + * \ingroup MODULE_CONTROL + * + * \brief Reads movie header, analyzes movie information, and buffers data. + * \param err Optional error code + * + * This function opens the movie file and gets it ready for immediate playback, by reading and analyzing + * the header and decoding and buffering video data. It allows a movie to start playing immediately when + * CriMvEasyPlayer::Start() is called, without an initial delay. + * + * When this function is called, the handle status changes to MVEASY_STATUS_DECHDR. Once EasyPlayer + * has finished reading and analyzing the movie data, the status changes to MVEASY_STATUS_PREP and EasyPlayer + * begins decoding video data. When the initial video data has been decoded and buffered, the status changes to + * MVEASY_STATUS_READY. + * + * The amount of data that is buffered, in seconds, is based on the value set by CriMvEasyPlayer::SetBufferingTime(). + * By default, this is 1 second. + * + * When the status is MVEASY_STATUS_READY, movie playback will start imediately when CriMvEasyPlayer::Start() + * is called. + * + * \remarks + * Unless you CriMvEasyPlayer::DecodeHeader() first, this function can only be called when the handle status + * is MVEASY_STATUS_STOP or MVEASY_STATUS_PLAYEND. + * + * \remarks + * You must either call CriMvEasyPlayer::SetFile() or CriMvEasyPlayer::SetData(), or provide a file request + * callback with CriMvEasyPlayer::SetFileRequestCallback(), before calling this function. + * + * \remarks + * Once this function has been called, CriMvEasyPlayer::ExecuteDecode() and CriMvEasyPlayer::Update() must be + * called periodically in order for this function to have any effect. Otherwise, the handle status will + * never change. + * + * \sa CriMvEasyPlayer::GetStatus(), CriMvEasyPlayer::DecodeHeader(), CriMvEasyPlayer::Start(), + * CriMvEasyPlayer::SetBufferingTime(), CriMvInputBufferInfo + */ + /*JP + * \ingroup MODULE_CONTROL + * \brief 再生準備(ヘッダ解析とバッファリング) + * \param err エラー情報(省略可) + * + * ムービの再生は開始せず、ヘッダ解析と再生準備のみを行って待機するための関数です。
+ * この関数を使用して再生準備を事前に済ませることにより、ムービ再生開始のタイミングを細かく制御することができます。
+ * (再生準備無しで再生開始関数を呼び出した場合は、実際に再生が始まるまでにタイムラグが発生します。)
+ * 本関数を呼び出すと、EasyPlayerのハンドル状態はMVEASY_STATUS_STOP → MVEASY_STATUS_DECHDR → MVEASY_STATUS_PREP と遷移していき、 + * 再生準備が完了するとMVEASY_STATUS_READYとなります。 + * + * ハンドル状態がMVEASY_STATUS_READYの時に、 CriMvEasyPlayer::Start() を呼ぶことで再生を開始することができます。 + * + * CriMvEasyPlayer::DecodeHeader() の呼び出し無しでこの関数を呼び出す場合は、CriMvEasyPlayerのハンドル状態が + * MVEASY_STATUS_STOPかMVEASY_STATUS_PLAYEND でなければいけません。 + * + * 再生開始前には CriMvEasyPlayer::SetFile() か CriMvEasyPlayer::SetData() でムービデータを指定してください。
+ * ただし、ファイル要求コールバック関数を登録している場合は事前のムービデータ設定は省略することだきます。 + * + * \sa CriMvEasyPlayer::GetStatus(), CriMvEasyPlayer::DecodeHeader(), CriMvEasyPlayer::Start(), + * CriMvEasyPlayer::SetBufferingTime(), CriMvInputBufferInfo + */ + void Prepare(CriError &err=CriMv::ErrorContainer); + + /*EN + * \ingroup MODULE_CONTROL + * + * \brief Starts movie playback + * \param err Optional error code + * + * Opens the movie and starts playback. If CriMvEasyPlayer::Prepare() was not called, there will be a + * delay while the library reads the movie header and buffers the initial data. If CriMvEasyPlayer::Prepare() + * was called and the handle status is MVEASY_STATUS_READY, playback will start as soon as this function is called. + * + * \remarks + * If you call this function without calling CriMvEasyPlayer::DecodeHeader() or CriMvEasyPlayer::Prepare() + * first, this function can only be called when the handle status is MVEASY_STATUS_STOP, MVEASY_STATUS_PLAYEND, + * or MVEASY_STATUS_READY. + * + * \remarks + * You must either call CriMvEasyPlayer::SetFile() or CriMvEasyPlayer::SetData(), or provide a file request + * callback with CriMvEasyPlayer::SetFileRequestCallback(), before calling this function. + * + * \remarks + * Once this function has been called, CriMvEasyPlayer::ExecuteDecode() and CriMvEasyPlayer::Update() must be + * called periodically in order for this function to have any effect. Otherwise, the movie will not play and + * the handle status will never change. + * + * \sa CriMvEasyPlayer::GetStatus(), CriMvEasyPlayer::DecodeHeader(), CriMvEasyPlayer::Prepare() + */ + /*JP + * \ingroup MODULE_CONTROL + * \brief 再生開始 + * \param err エラー情報(省略可) + * + * ムービの再生を開始します。
+ * CriMvEasyPlayer::Prepare()を呼ばずに、本関数を呼び出した場合は、ムービの解析と再生の準備を行うため、 + * 実際にムービの再生が始まるまでにタイムラグが発生します。
+ * CriMvEasyPlayer::Prepare()を先に呼び出して、ハンドル状態がMVEASY_STATUS_READYになっていれば、 + * この関数を呼び出してすぐに再生が始まります。 + * + * CriMvEasyPlayer::DecodeHeader() または CriMvEasyPlayer::Prepare() の呼び出し無しでこの関数を呼び出す場合は、 + * CriMvEasyPlayerのハンドル状態が MVEASY_STATUS_STOPかMVEASY_STATUS_PLAYEND でなければいけません。 + * + * 再生開始前には CriMvEasyPlayer::SetFile() か CriMvEasyPlayer::SetData() でムービデータを指定してください。
+ * ただし、ファイル要求コールバック関数を登録している場合は事前のムービデータ設定は省略することだきます。 + * + * \sa CriMvEasyPlayer::GetStatus(), CriMvEasyPlayer::DecodeHeader(), CriMvEasyPlayer::Prepare() + */ + void Start(CriError &err=CriMv::ErrorContainer); + + /*EN + * \ingroup MODULE_CONTROL + * + * \brief Stops movie playback; resets a handle that is in an ERROR state, + * \param err Optional error code + * + * Tells the movie to stop playing and returns immediately. Note that this does not actually stop playback; + * an application must continue to call CriMvEasyPlayer::Update() and CriMvEasyPlayer::ExecuteDecode() until + * the status changes to MVEASY_STATUS_STOP. + * + * Once the handle is in the MVEASY_STATUS_STOP state, it can be reused for a different movie. + * + * If the handle state is MVEASY_STATUS_ERROR, an application must call this function and wait for the status + * to change to MVEASY_STATUS_STOP before destroying or reusing the player handle. + * + * In principle, this function does not reset any EasyPlayer handle parameters that were explicitly set via + * any of the settings APIs, so an application can replay the same movie by simply calling CriMvEasyPlayer::Start() + * once the state has changed to MVEASY_STATUS_STOP. However, calling this function will reset the following + * parameters: + * + * - The pause state (see CriMvEasyPlayer::Pause()) will be reset to OFF (not paused). + * - If a file request callback has been set (via CriMvEasyPlayer::SetFileRequestCallback()), the movie + * data information will be reset. + * + * See the description of CriMvEasyPlayer::ResetAllParameters() for a comparison of the parameters that are + * affected by that function and by this function. + * + * \remarks + * This function may call CriMvSoundInterface::Stop() and CriMvFileReaderInterface::Close(). For an EasyPlayer + * handle to change to MVEASY_STATUS_STOP, the sound and file interfaces need to transition to their STOP states. + * In the case of CriMvSoundInterface, this means that CriMvSoundInterface::GetStatus() will return + * MVEASY_SOUND_STATUS_STOP. For CriMvFileReaderInterface, this means that CriMvFileReaderInterface::GetCloseStatus() + * will return ASYNC_STATUS_COMPLETE. + * + * \sa CriMvEasyPlayer::Status, CriMvEasyPlayer::GetStatus(), CriMvEasyPlayer::ResetAllParameters() + */ + /*JP + * \ingroup MODULE_CONTROL + * \brief 再生停止/エラー状態からの復帰 + * \param err エラー情報(省略可) + * + * ムービ再生停止の要求を出します。本関数は即時復帰関数です。本関数内で全ての停止処理が実行されるわけではありません。
+ * 本関数呼出し後、再生状態が MVEASY_STATUS_STOP なるまでは通常のメインループ処理を動かしてください。
+ * 具体的には CriMvEasyPlayer::Update(), CriMvEasyPlayer::ExecuteDecode() が通常通り呼び出される必要があります。 + * + * 再生状態が MVEASY_STATUS_ERROR になった場合は、本関数を呼び出して MVEASY_STATUS_STOP を待ってください。
+ * + * forループなどによるローカルループで状態変更待ちをしても MVEASY_STATUS_STOP にはなりません。
+ * + * 本関数を呼び出しても、アプリケーションが再生ハンドルに設定した各種パラメータは原則としてリセットされません。
+ * MVEASY_STATUS_STOP 状態になったあと、もう一度再生を開始すると前回と同じパラメータで再生を行うことができます。
+ * 例外的に本関数でリセットされるパラメータは以下のものがあります。 + * - CriMvEasyPlayer::Pause() によるポーズ状態は、OFFにリセットされます。 + * - ファイル要求コールバック関数の登録がある場合、ムービファイル名(またはメモリ)の情報はリセットされます。 + * + * リセットされるパラメータ一覧は CriMvEasyPlayer::ResetAllParameters() の説明を参照してください。 + * + * 本関数は必要に応じて CriMvSoundInterface::Stop() および CriMvFileReaderInterface::Close() を呼び出します。
+ * EasyPlayer ハンドルが MVEASY_STATUS_STOP 状態になるためには、各インタフェースが停止状態にならなければいけません。
+ * サウンドインタフェースの場合、 CriMvSoundInterface::GetStatus()が MVEASY_SOUND_STATUS_STOP を返すこと。
+ * ファイル読み込みインタフェースの場合、 CriMvFileReaderInterface::GetCloseStatus() が、ASYNC_STATUS_COMPLETE + * を返さなければいけません。 + * + * \sa CriMvEasyPlayer::Status, CriMvEasyPlayer::GetStatus(), CriMvEasyPlayer::ResetAllParameters() + */ + void Stop(CriError &err=CriMv::ErrorContainer); + + /*EN + * \ingroup MODULE_CONTROL + * + * \brief Pauses or resumes movie playback + * \param sw Pause state. ON (1) will pause playback, OFF (0) will resume it. + * \param err Optional error code + * + * Pauses or resumes movie playback, depending on the argument. If \a sw is ON (1), playback will be paused. + * If \a sw is OFF (0), playback will be resumed. + * + * \remarks + * This function will call CriMvSoundInterface::Pause() and CriMvSystemTimerInterface::Pause() with the + * provided argument. + * + * \remarks + * Calling CriMvEasyPlayer::Stop() or CriMvEasyPlayer::ResetAllParameters() will set the pause state to OFF. + * + * \sa CriMvSoundInterface::Pause(), CriMvSystemTimerInterface::Pause() + */ + /*JP + * \ingroup MODULE_CONTROL + * \brief 再生の一時停止または再開 + * \param sw ポーズスイッチ。ポーズONの場合は1、ポーズOFF(レジューム)の場合は0を指定します。 + * \param err エラー情報(省略可) + * + * 本関数の動作は引数に依存します。
+ * 引数 sw がON(1)なら、一時停止。引数 sw がOFF(0)なら再生再開です。 + * + * CriMvEasyPlayer::Stop() または CriMvEasyPlayer::ResetAllParameters を呼び出すとポーズ状態はOFFにリセットされます。 + * + * この関数は CriMvSoundInterface::Pause() と CriMvSystemTimerInterface::Pause() を同じ引数で呼び出します。 + * + * \sa CriMvSoundInterface::Pause(), CriMvSystemTimerInterface::Pause() + */ + void Pause(CriBool sw, CriError &err=CriMv::ErrorContainer); + + CriBool IsPaused(CriError &err=CriMv::ErrorContainer); + + /* オプション設定/取得 */ + /*EN + * \ingroup MODULE_OPTION + * + * \brief Sets the type of timer used for video synchronization + * \param type Type of timer to use + * \param err Optional error code + * + * In order to display video frames at the proper rate, CRI Movie uses a timer to determine when the + * next frame should be shown. For a movie with an audio track, you would typically use the + * MVEASY_TIMER_AUDIO timer type. For a movie with no audio, the MVEASY_TIMER_SYSTEM type timer + * should be used. + * + * The default is the timer type that was passed to CriMvEasyPlayer::Create(). If this value + * was NULL, a system timer (MVEASY_TIMER_SYSTEM) will be used. + * + * \remarks + * If an audio timer (MVEASY_TIMER_AUDIO) is wanted, it must be created and passed to + * CriMvEasyPlayer::Create(). + * + * \remarks + * If the movie does not have an audio track, CRI Movie will use a MVEASY_TIMER_SYSTEM regardless of + * the value set by this function. + * + * \sa CriMvEasyPlayer::GetMasterTimer(), CriMvEasyPlayer::Create(), TimerType + */ + /*JP + * \ingroup MODULE_OPTION + * \brief マスタタイマ種別の指定 + * \param type マスタタイマ種別 + * \param err エラー情報(省略可) + * + * ビデオフレームの時刻管理に使用するタイマ種別を指定します。
+ * デフォルトはハンドル作成時に指定するシステムタイマです。
+ * ビデオフレームの表示タイミングをオーディオの時刻と同期させたいときはオーディオタイマを指定してください。
+ * オーディオタイマを指定した場合でも、再生するムービにオーディオが含まれていない場合はシステムタイマ同期となります。 + * + * \sa CriMvEasyPlayer::GetMasterTimer(), CriMvEasyPlayer::Create() + */ + void SetMasterTimer(TimerType type, CriError &err=CriMv::ErrorContainer); // default is SYSTEM + + /*EN + * \ingroup MODULE_OPTION + * + * \brief Returns the type of timer currently being used by the EasyPlayer handle + * \param err Optional error code + * \return The current timer type + * + * Returns the current type of timer used to synchronize video frames. This value can be changed + * by calling CriMvEasyPlayer::SetMasterTimer(). Otherwise, the timer type is set when the handle + * is created. + * + * \sa CriMvEasyPlayer::SetMasterTimer(), CriMvEasyPlayer::Create(), TimerType + */ + /*JP + * \ingroup MODULE_OPTION + * \brief マスタタイマ種別の取得 + * \param err エラー情報(省略可) + * \return 現在設定されているマスタタイマ種別 + * + * 現在設定されているマスタタイマ種別を取得します。 + * + * \sa CriMvEasyPlayer::SetMasterTimer() + */ + TimerType GetMasterTimer(CriError &err=CriMv::ErrorContainer); + + /*EN + * \ingroup MODULE_OPTION + * + * \brief Sets the number of internal video buffers + * \param npools The number of buffers to use; must be greater than 0 + * \param err Optional error code + * + * CRI Movie uses internal memory, or frame pools, to buffer decoded frames before display. + * More frame pools can help smooth out playback under high CPU loads. + * + * \remarks + * By default, the number of pools is 1. To change the value, this function must be called + * before starting playback (with either CriMvEasyPlayer::Prepare() or CriMvEasyPlayer::Start()). + */ + /*JP + * \ingroup MODULE_OPTION + * \brief 内部ビデオバッファ(フレームプール)数の指定 + * \param npools 内部ビデオバッファ数(最低でも1) + * \param err エラー情報(省略可) + * + * EasyPlayerハンドル内部のビデオバッファ数を指定します。
+ * この内部ビデオバッファはデコード結果を蓄えておくためのもので、フレームプールと呼びます。
+ * フレームプールが多いほど先行してビデオデコードを進めることができるため、デコードの + * 負荷変動が大きかったり、デコードに使用できるCPU時間の変動が大きい場合にもスムーズな再生を + * 行いやすくなります。
+ * デフォルトのフレームプール数は1です。
+ * フレームプール数を変更したい場合は、再生開始前( CriMvEasyPlayer::Prepare()または CriMvEasyPlayer::Start())に + * 本関数を実行してください。 + */ + void SetNumberOfFramePools(CriUint32 npools, CriError &err=CriMv::ErrorContainer); + + /*EN + * \ingroup MODULE_OPTION + * + * \brief Sets the amount of movie data that will be buffered, in seconds + * \param sec Buffering time, in seconds + * \param err Optional error code + * + * CRI Movie buffers enough raw data from disk to allow for smooth playback and to reduce disk reads. + * The buffer size is based on the bitrate of the movie, and other movie parameters. + * + * By default, this buffer will be large enough to hold 1 second worth of playback. + * + * To determine the current buffering time, look at the \a buffering_time field of the + * CriMvStreamingParameters structure, which is retrieved by calling CriMvEasyPlayer::GetMovieInfo(). + * + * \remarks + * If this function is called, it must be called before starting playback (with either + * CriMvEasyPlayer::Prepare() or CriMvEasyPlayer::Start()). + * + * \remarks + * Passing \a 0.0 as the value of \a sec will reset the buffering time to the default value. + * + * \remarks + * If an application calls CriMvEasyPlayer::SetStreamingParameters() for a handle, this function + * can not be used with that handle. + * + * \remarks + * The value set by this function, along with the value set by CriMvEasyPlayer::SetReloadThresholdTime(), + * determine how often data is read from disk. See the description of + * CriMvEasyPlayer::SetReloadThresholdTime() for details. + * + * \sa CriMvEasyPlayer::SetReloadThresholdTime(), CriMvEasyPlayer::GetInputBufferInfo(), + * CriMvStreamingParameters + */ + /*JP + * \ingroup MODULE_OPTION + * \brief 入力データのバッファリング時間の指定 + * \param sec バッファリング時間。単位は秒。 + * \param err エラー情報(省略可) + * + * ストリーミング再生でバッファリングする入力データの量を秒単位の時間で指定します。
+ * EasyPlayerは、バッファリング時間とムービのビットレート等から読み込みバッファのサイズを決定します。 + * + * デフォルトのバッファリング時間は、再生開始時点でアプリケーションが作成済みのEasyPlayerハンドル数 + * に依存して決まります。EasyPlayerハンドル1つにつき1秒のバッファリング時間を確保します。もしもアプリ + * ケーションが3つのEasyPlayerハンドルを作成していた場合、バッファリング時間は3秒となります。 + * + * EasyPlayerハンドルが何秒分のバッファリング時間になっているかは CriMvEasyPlayer::GetMovieInfo + * 関数で取得する CriMvStreamingParameters 構造体の変数 buffering_time で確認できます。 + * + * 本関数の呼び出しは、 CriMvEasyPlayer::Prepare 関数または CriMvEasyPlayer::Start 関数の前までに実行してください。 + * + * バッファリング時間に 0.0f を指定した場合、バッファリング時間はライブラリのデフォルト値となります。
+ * また、アプリケーションが CriMvEasyPlayer::SetStreamingParameters 関数を呼び出した場合は本関数で + * 設定した値よりも、 CriMvEasyPlayer::SetStreamingParameters 関数の指定が優先されます。 + * + * \sa CriMvEasyPlayer::SetReloadThresholdTime(), CriMvEasyPlayer::GetInputBufferInfo() + */ + void SetBufferingTime(CriFloat32 sec, CriError &err=CriMv::ErrorContainer); + + /*EN + * \ingroup MODULE_OPTION + * + * \brief Determines how often the movie data buffer is refilled from disk + * \param sec Number of seconds of playback time to buffer + * \param err Optional error code + * + * EasyPlayer buffers raw data from disk to allow for smooth playback. How often it refills + * its buffers is determined by this function. When the amount of data remaining, in seconds, + * falls below this value, EasyPlayer will call into the FileReader module for this handle in + * order to read more data. + * + * SetBufferingTime() sets a "low water mark" for the data buffer. For instance, if an application + * sets the buffer size to 4 seconds (with CriMvEasyPlayer::SetBufferingTime()), and sets the reload + * threshold to 1 second, then CRI Movie will initially fill the buffer with 4 seconds worth of + * data. After 3 seconds worth of data have been decoded and consumed, there will be less than + * \a reload \a threshold seconds of data remaining, and CRI Movie will refill the buffer. + * + * \remarks + * The default value for \a sec is 0.8s. + * + * \remarks + * If this function is called, it must be called before starting playback (with either + * CriMvEasyPlayer::Prepare() or CriMvEasyPlayer::Start()). + * + * \sa CriMvEasyPlayer::SetBufferingTime(), CriMvEasyPlayer::GetInputBufferInfo(), CriMvFileReaderInterface + */ + /*JP + * \ingroup MODULE_OPTION + * \brief 再読み込み閾値の時間指定 + * \param sec 時間指定による再読み込み閾値。単位は秒。 + * \param err エラー情報(省略可) + * + * EasyPlayerハンドルは、入力バッファ内のデータが再読み込み閾値以下になった時に次のデータ読み込みを実行します。 + * 再読み込み閾値は本関数による指定時間とムービデータのビットレートによって自動的に計算されます。 + * 再読み込み閾値は時間[秒]で指定します。デフォルト値は0.8秒です。 + * + * ムービ再生中にデータを裏読みする場合などにシーク回数を減らすために閾値設定を利用することができます。 + * 例えば、バッファリング時間を2秒、再読み込み閾値を1秒に設定すると、ムービデータの読み込みは約1秒に1回の実行になります。 + * こうすることで、約1秒の間はデータの読み込みを連続的に行うことができます。 + * + * ムービを再生しながらユーザデータの読み込みを行う場合、ユーザデータの読み込みは本関数で指定した時間以内に読み込み + * 処理が終わるようにしてください。サイズの大きなデータは複数に分割して読み込むなどの対処が必要になります。 + * 本関数で指定した時間以内にユーザデータの読み込みが終わらなかった場合、ムービデータが枯渇してムービ再生が滞ります。 + * + * 本関数の呼び出しは、 CriMvEasyPlayer::Prepare 関数または CriMvEasyPlayer::Start 関数の前までに実行してください。 + * + * ムービ再生中の入力バッファのデータ量や再読み込み閾値のサイズは、CriMvEasyPlayer::GetInputBufferInfo で取得可能です。 + * + * \sa CriMvEasyPlayer::SetBufferingTime(), CriMvEasyPlayer::GetInputBufferInfo() + */ + void SetReloadThresholdTime(CriFloat32 sec, CriError &err=CriMv::ErrorContainer); + + /*EN + * \ingroup MODULE_OPTION + * + * \brief Retrieves input data buffering settings + * \param ibuf_info Input buffer information structure + * \param err Optional error code + * + * Populates the passed CriMvInputBufferInfo structure with the values of the settings + * for the raw input buffer size, the reload interval, and the amount of data currently buffered. + * + * \remarks + * This function can be called once the handle status has transitioned to MVEASY_STATUS_WAIT_PREP. + * + * \sa CriMvInputBufferInfo, CriMvEasyPlayer::SetBufferingTime(), CriMvEasyPlayer::SetReloadThresholdTime() + */ + /*JP + * \ingroup MODULE_OPTION + * \brief 入力バッファ情報の取得 + * \param ibuf_info 入力バッファ情報 + * \param err エラー情報(省略可) + * + * 入力バッファ情報 CriMvInputBufferInfo を取得します。
+ * 入力バッファ情報はEasyPlayerハンドルの状態が MVEASY_STATUS_WAIT_PREP 以降になったあと取得できます。
+ * + * \sa CriMvInputBufferInfo, CriMvEasyPlayer::SetBufferingTime(), CriMvEasyPlayer::SetReloadThresholdTime() + */ + void GetInputBufferInfo(CriMvInputBufferInfo &ibuf_info, CriError &err=CriMv::ErrorContainer); + + /*EN + * + * \brief Sets the maximum bitrate EasyPlayer will assume for movie data + * \param max_bitrate Maximum bitrate, in bits/second + * \param err Optional error code + * + * EasyPlayer determines the size of its input data buffer by the movie's bitrate, the buffering time, + * and other movie parameters. In normal usage, an application should not need to call this function. + * However, it can be useful when doing concatenated playback of several movies sequentially. + * + * If the bitrate of the first movie is smaller or larger than the next movie, EasyPlayer can choose + * a buffer size that will be appropriate for the first movie, but either too small for the next + * (causing excessive disk reads or playback stuttering) or too large (using more memory than necessary). + * + * Passing a value of 0 for \a max_bitrate will cause the handle to revert to its default behavior + * for determining maximum bitrate. + * + * \remarks + * The value set by this function will not be reflected in the \a max_bitrate field of the + * CriMvStreamingParameters structure, which will contain the actual value as stored in the movie's + * header. + * + * \remarks + * If this function is called, it must be called before starting playback (with either + * CriMvEasyPlayer::Prepare() or CriMvEasyPlayer::Start()). + * + * \remarks + * If an application calls CriMvEasyPlayer::SetStreamingParameters() for a handle, this function + * can not be used with that handle. + * + * \remarks + * For details about concatenated playback, see the description of CriMvEasyPlayer::SetFileRequestCallback(). + * + * \sa CriMvEasyPlayer::SetBufferingTime(), CriMvEasyPlayer::SetReloadThresholdTime(), + * CriMvEasyPlayer::SetFileRequestCallback() + */ + /*JP + * \ingroup MODULE_OPTION + * \brief 最大ビットレートの指定 + * \param max_bitrate 最大ビットレート(bit per second) + * \param err エラー情報(省略可) + * + * ムービデータの最大ビットレートを指定します。最大ビットレートはストリーム再生用に確保するバッファサイズに影響します。
+ * + * 単純再生時は本関数を呼び出す必要はありません。EasyPlayerハンドルが自動的に最大ビットレートを取得して必要なだけの + * 読み込みバッファを確保します。
+ * + * 連結再生時に、先頭のムービファイルのビットレートが後続のムービファイルと比べて極端に小さい場合には、本関数を使用して + * 明示的に最大ビットレートを大きく指定してください。
+ * + * 本関数で設定した最大ビットレートは、CriMvEasyPlayer::GetMovieInfo 関数で取得するムービ情報には反映されません。 + * CriMvEasyPlayer::GetMovieInfo 関数で取得できるのはムービデータの本来の情報です。
+ * + * 本関数の呼び出しは、 CriMvEasyPlayer::Prepare 関数または CriMvEasyPlayer::Start 関数の前までに実行してください。
+ * + * 最大ビットレートに 0を指定した場合、最大ビットレートはムービデータの持つ値となります。
+ * また、アプリケーションが CriMvEasyPlayer::SetStreamingParameters 関数を呼び出した場合は本関数で + * 設定した値よりも、 CriMvEasyPlayer::SetStreamingParameters 関数の指定が優先されます。 + * + * \sa CriMvEasyPlayer::SetBufferingTime(), CriMvEasyPlayer::SetReloadThresholdTime(), + * CriMvEasyPlayer::SetFileRequestCallback() + */ + void SetMaxBitrate(CriUint32 max_bitrate, CriError &err=CriMv::ErrorContainer); + + /*EN + * \ingroup MODULE_OPTION + * + * \brief Sets the audio playback track + * \param track Audio track number + * \param err Optional error code + * + * If a movie has multiple audio tracks (for instance, English and Spanish versions), this function + * will determine which track plays. By default, the first audio track is used. + * + * To determine the number of audio tracks in the movie, call CriMvEasyPlayer::GetMovieInfo() and + * look at the \a num_audio field of the CriMvStreamingParameters structure. + * + * If the movie does not have any audio, this function has no effect. + * + * \remarks + * To use the default setting, set \a track to CRIMV_AUDIO_TRACK_AUTO. + * + * \remarks + * To turn off audio altogether, set \a track to CRIMV_AUDIO_TRACK_OFF. + * + * \sa CriMvEasyPlayer::GetMovieInfo() + */ + /*JP + * \ingroup MODULE_OPTION + * \brief 再生するオーディオトラックの指定 + * \param track 再生するオーディオトラック + * \param err エラー情報(省略可) + * + * ムービが複数のオーディオトラックを持っている場合に、再生するオーディオを指定します。
+ * 再生開始前( CriMvEasyPlayer::Prepare()または CriMvEasyPlayer::Start())に本関数を実行してください。 + * + * 本関数を実行しなかった場合は、もっとも若い番号のオーディオトラックを再生します。
+ * CriMvEasyPlayer::DecodeHeader()と CriMvEasyPlayer::GetMovieInfo()を使うことで、どのチャネルに + * どんなオーディオが入っているかを再生開始前に知ることができます。 + * + * データが存在しないトラック番号を指定した場合は、オーディオは再生されません。 + * + * トラック番号としてCRIMV_AUDIO_TRACK_OFFを指定すると、例えムービにオーディオが含まれていたと + * してもオーディオは再生しません。 + * + * また、デフォルト設定(もっとも若いチャネルのオーディオを再生する)にしたい場合は、 + * チャネルとしてCRIMV_AUDIO_TRACK_AUTOを指定してください。 + * + * \sa CriMvEasyPlayer::GetMovieInfo(), CriMvEasyPlayer::DecodeHeader() + */ + void SetAudioTrack(CriSint32 track, CriError &err=CriMv::ErrorContainer); + + /*EN + * \ingroup MODULE_OPTION + * + * \brief Turns movie looping on or off + * \param sw Looping value + * \param err Optional error code + * + * If \a sw is 1 (ON), the movie will loop continuously. + * If \a sw is 0 (OFF), the movie will play normally. + * + * In normal usage, a movie will play once, with the handle status changing to MVEASY_STATUS_PLAYEND + * when it completes. When looping is ON, this behavior changes. When the movie reaches the + * end, it will immediately start playing again from the beginning, and the status will continue to + * toggle between MVEASY_STATUS_PLAYING and MVEASY_STATUS_PREP. + * + * If looping is ON, and the playback is from a file, EasyPlayer will call CriMvFileReaderInterface::Seek() + * as necessary to reset the file pointer. + * + * \remarks + * If looping is ON, and an application sets it to OFF while the movie is playing, playback might + * not stop at the end of the movie. In that case, playback will end after the next loop iteration. + * + * \sa CriMvEasyPlayer::GetLoopFlag(), CriMvFileReaderInterface::Seek() + */ + /*JP + * \ingroup MODULE_OPTION + * \brief ループ再生フラグの指定 + * \param sw ループスイッチ。ONの場合はループあり、OFFの場合はループ無しになります。 + * \param err エラー情報(省略可) + * + * ループ再生の有無を設定します。デフォルトはループOFFです。
+ * ループ再生ONにした場合は、ムービの終端まで再生してもハンドル状態はMVEASY_STATUS_PLAYENDにならず、 + * ムービの先頭から再生を繰り返します。
+ * ファイル名指定で再生している場合は、最後まで読み込んだあと CriMvFileReaderInterface::Seek()を使って + * 読み込み位置をファイルの先頭に戻します。 + * + * ループ再生OFFに設定した場合は、そのとき読み込んでいたムービの終端まで再生すると、 + * ハンドル状態がMVEASY_STATUS_PLAYENDに遷移します。
+ * 再生中にループOFFにした場合、タイミングによっては、再生中のムービ終端で終わらず、次の繰り返し + * 再生まで実行されます。 + * + * 現在のループ設定を取得するには CriMvEasyPlayer::GetLoopFlag()を使ってください。 + * + * \sa CriMvEasyPlayer::GetLoopFlag(), CriMvFileReaderInterface::Seek() + */ + void SetLoopFlag(CriBool sw, CriError &err=CriMv::ErrorContainer); + + /*EN + * \ingroup MODULE_OPTION + * + * \brief Retrieves the value of the looping flag + * \return The current looping setting + * + * By default, looping is OFF and playback will stop when it reaches the end. You can + * change this behavior by calling CriMvEasyPlayer::SetLoopFlag(). + * + * \sa CriMvEasyPlayer::SetLoopFlag() + */ + /*JP + * \ingroup MODULE_OPTION + * \brief ループ再生フラグの取得 + * \param err エラー情報(省略可) + * \return 現在のループ再生設定 + * + * 現在のループ設定を取得します。 + * ループ設定は CriMvEasyPlayer::SetLoopFlag() で変更することができます。 + * + * \sa CriMvEasyPlayer::SetLoopFlag() + */ + CriBool GetLoopFlag(CriError &err=CriMv::ErrorContainer); + + /*EN + * \ingroup MODULE_OPTION + * + * \brief Gets the amount of time that a movie has been playing + * \param count Number of timer units since the movie started playing + * \param unit Number of timer units per second + * \param err Optional error code + * + * This function retrieves the absolute time that has elapsed since a movie started playing. + * The time value is returned in two parts - a counter with an arbitrary interval, and the + * number of timer ticks per second. To determine the playing time in seconds, divide + * \a count by \a unit. + * + * Before playback has started, and after it has stopped, this function will return a \a count value of 0. + * + * The value retrieved is the value of the master timer for the handle, not the time of the current frame itself. + * To get the video frame time, check the CriMvFrameInfo structure once you have retrieved the frame. + * + * \remarks + * Note that this function provides an absolute playback time - it does not wrap to 0 + * when the movie loops. + * + */ + /*JP + * \ingroup MODULE_OPTION + * \brief 再生時刻の取得 + * \param count タイマカウント + * \param unit 1秒あたりのタイマカウント値。count ÷ unit で秒単位の時刻となります。 + * \param err エラー情報(省略可) + * + * タイマ時刻を取得します。時刻はcountとunitの二つの変数で表現します。
+ * count ÷ unit で秒単位の時刻となるような値を返します。
+ * 再生開始前( CriMvSoundInterface::Start()呼び出し前)および + * 再生停止後( CriMvSoundInterface::Stop()呼び出し後)は、時刻0(タイマカウントが0)を返します。
+ * 本関数はマスタタイマで指定されたタイマの時刻を返すだけで、ビデオフレームの時刻を返すものではありません。
+ * 取得したビデオフレームの本来の表示時刻は、ビデオフレーム取得時の CriMvFrameInfo 構造体を参照してください。 + */ + void GetTime(CriUint64 &count, CriUint64 &unit, CriError &err=CriMv::ErrorContainer); // only refer time of SyncMasterTimer + + /*EN + * \ingroup MODULE_OPTION + * + * \brief Gets information about the movie + * \param stmprm Movie information structure + * \param err Optional error code + * \return TRUE if movie information was successfully retrieved + * \return FALSE if the header has not yet been decoded, or if an error occurred + * + * Populates the passed \a CriMvStreamingParameters structure with information about the current movie, + * including the bitrate, resolution, audio track information, subtitle availability, and more. + * + * This function is available once the handle status has changed to MVEASY_STATUS_WAIT_PREP. If an application + * needs this information before starting playback (for instance, to set up for playing subtitles, or to + * allocate a display surface based on the size of the movie), call CriMvEasyPlayer::DecodeHeader(), then + * call GetMovieInfo(). + * + * \remarks + * When doing concatenated playback (via CriMvEasyPlayer::SetFileRequestCallback()), GetMovieInfo() will + * return information about the currently playing movie. + * + * \sa CriMvEasyPlayer::DecodeHeader(), CriMvEasyPlayer::SetFileRequestCallback() + */ + /*JP + * \ingroup MODULE_OPTION + * \brief ムービ情報の取得 + * \param stmprm ムービ情報 + * \param err エラー情報(省略可) + * + * ムービ情報 CriMvStreamingParameters を取得します。
+ * ムービ情報からは主にビットレートや解像度、オーディオ数などがわかります。
+ * ムービ情報はEasyPlayerハンドルの状態が MVEASY_STATUS_WAIT_PREP 以降になったあと取得できます。
+ * 再生開始前にムービ情報を知りたい場合は、 CriMvEasyPlayer::DecodeHeader()を呼び出してヘッダ解析を行ってください。 + * + * 連結再生を行った場合、最後に取得したフレームを含むムービファイルについての情報を返します。 + * + * \sa CriMvEasyPlayer::DecodeHeader() + */ + CriBool GetMovieInfo(CriMvStreamingParameters &stmprm, CriError &err=CriMv::ErrorContainer); + + /*EN + * \ingroup MODULE_OPTION + * + * \brief Changes the parameters for the movie + * \param stmprm Movie information structure + * \param err Optional error code + * + * This is a DEBUG function and should not normally be used by applications. + * + * This function allows an application to change the streaming parameters for the movie as a whole. + * It is available once the handle status has changed to MVEASY_STATUS_WAIT_PREP. + * + * To use this function, first call CriMvEasyPlayer::DecodeHeader(), then call CriMvEasyPlayer::GetMovieInfo() + * to retrieve the current movie parameters. Change the fields of the CriMvStreamingParameters structure + * as appropriate, then call SetStreamingParameters(). + * + * \sa CriMvEasyPlayer::GetMovieInfo(), CriMvEasyPlayer::DecodeHeader() + */ + /*JP + * \ingroup MODULE_OPTION + * \brief ストリーミングパラメータの変更 + * \param stmprm ストリーミングパラメータ + * \param err エラー情報(省略可) + * + * 本関数は通常、アプリケーションからは使用しません。デバッグ用の関数です。 + * + * ムービ再生のためのストリーミングパラメータをEasyPlayerハンドルに設定します。
+ * ストリーミングパラメータが指定できるのは、EasyPlayerハンドル状態がMVEASY_STATUS_WAIT_PREPの時だけです。
+ * この関数は、読み込みバッファサイズなど細かなパラメータを全てアプリケーションで調整したい場合に使います。
+ * CriMvEasyPlayer::DecodeHeader()でヘッダ解析を行ったあと、 CriMvEasyPlayer::GetMovieInfo()で取得できる + * ムービ情報がそのままストリーミングパラメータとなりますので、調整したい値を変更して、本関数で設定しなお + * してください。 + * + * \sa CriMvEasyPlayer::GetMovieInfo(), CriMvEasyPlayer::DecodeHeader() + */ + void SetStreamingParameters(CriMvStreamingParameters *stmprm, CriError &err=CriMv::ErrorContainer); + + /*EN + * \ingroup MODULE_VIDEO_FRAME + * + * \brief Determine if a new video frame can be displayed + * + * \param err Optional error code + * + * \return TRUE if a frame is ready to be displayed + * \return FALSE if the movie is paused or not playing, or if a new frame is + * not yet decoded or ready to be displayed + * + * Each frame in a movie corresponds to an absolute time, with the first frame being time 0. + * The playback time is controlled by the master timer for this handle. + * If the time of the next frame is less than or equal to the current playback time, as determined + * by CriMvEasyPlayer::GetTime(), it is ready to be displayed, and this function will return TRUE. + * + * If an application needs to do some complex or lengthy processing before displaying a frame (such + * as locking a texture), it should call this function first. + * + * \remarks + * If the next frame has not yet been decoded, this function will return FALSE regardless of the playback time. + * + * \sa CriMvEasyPlayer::GetTime() + */ + /*JP + * \ingroup MODULE_VIDEO_FRAME + * \brief 次フレームの表示時刻判定 + * \param err エラー情報(省略可) + * \return 次のビデオフレームがすでに表示時刻になっている場合はTRUE(1)を返します。
+ * 次のビデオフレームがまだデコードできない場合はFALSE(0)を返します。 + * + * 次のビデオフレームがすでに表示時刻になっているかどうかを問い合わせます。
+ * もしもデコードが遅れていて次のビデオフレームがまだデコードできていない場合は、再生時刻に関係 + * なくFALSEを返します。
+ * つまりこの関数は「次のフレームが GetFrameOnTime関数で取得できるかどうか」を調べます。
+ * ビデオフレームが実際に取得するよりも先にやらなければいけない処理(例えばテクスチャロックなど) + * がある場合は、この関数でフレーム取得の成否を判定してから処理してください。 + * + * \sa CriMvEasyPlayer::GetTime() + */ + CriBool IsNextFrameOnTime(CriError &err=CriMv::ErrorContainer); + +#if !defined(XPT_TGT_EE) + /*EN + * \ingroup MODULE_VIDEO_FRAME + * + * \brief Loads video frame data into a buffer, in 32 bit ARGB format + * \param imagebuf Pointer to output buffer + * \param pitch Pitch of output buffer, in bytes + * \param bufsize Size of output buffer, in bytes + * \param frameinfo Video frame information structure + * \param err Optional error code + * \return TRUE if a frame was retrieved + * \return FALSE otherwise + * + * Copies the next decoded frame into the 32 bit ARGB image buffer pointed to by \a imagebuf. + * If the display time is less than the frame time, or if the frame has not yet been decoded, the + * \a frameinfo parameter will be cleared and this function will return FALSE. + * + * The \a pitch parameter is the width, in bytes, of each row of the frame image, including any padding. + * + * To determine if the next frame is ready to be displayed, call CriMvEasyPlayer::IsNextFrameOnTime(). + * + * CRI Movie decodes video frames into YUV420 format internally, and stores them in frame pools (see + * CriMvEasyPlayer::SetNumberOfFramePools()) for later display. When this function is called, + * the frame must first converted to ARGB format. This can be a very CPU-intensive operation, + * especially on the PS3 and Xbox360. For 1280 x 720 video resolution, this can use almost an + * entire vsync interval. On these platforms, we recommend implementing a pixel shader and calling + * CriMvEasyPlayer::GetFrameOnTimeAsYUVBuffers() instead. + * + * \remarks
+ * If an application uses this function, an application need to call CriMv::InitializeFrame32bitARGB() + * after CriMv::Initialize(). If an application calls this function without CriMv::InitializeFrame32bitARGB() + * calling, this function failed and an error callback occurs. + * + * \remarks + * This function is not available on the PS2. + * + * \sa CriMvEasyPlayer::IsNextFrameOnTime(), CriMvEasyPlayer::GetFrameOnTimeAsYUVBuffers(), + * CriMvEasyPlayer::SetNumberOfFramePools() + */ + /*JP + * \ingroup MODULE_VIDEO_FRAME + * \brief 32bit ARGBフォーマットでのデコード結果の取得 + * \param imagebuf 出力バッファポインタ + * \param pitch 出力バッファのピッチ [byte] + * \param bufsize 出力バッファのサイズ [byte] + * \param frameinfo 取得したビデオフレームの情報構造体 + * \param err エラー情報(省略可) + * \return フレームが取得できた場合はTRUE(1)、できなかった場合はFALSE(0)を返します。 + * + * 32bit ARGBフォーマットで、表示時刻になっているビデオフレームを取得します。
+ * この関数を呼び出す場合は、ARGBバッファの実体を確保したうえで呼び出す必要があります。
+ * ビデオフレームは引数imagebufで指定したARGBバッファに書き出されます。
+ * もしも次のビデオフレームの表示時刻になっていなかったり、デコードが終わっていなかった場合は + * フレーム取得できず、frameinfoの中身はクリアされます。
+ * 事前にビデオフレームが取得できるかどうかを知りたい場合は CriMvEasyPlayer::IsNextFrameOnTime() + * を使用してください。 + * + * 32bit ARGB の実際のピクセルデータの並びについては、そのプラットフォームで最も標準的な + * フォーマットになります。 + * + * 注意:
+ * 本関数を使用する場合はフレーム変換の初期化 CriMv::InitializeFrame32bitARGB()の呼び出しが + * 事前に必要です。フレーム変換の初期化を行わずに本関数を呼び出した場合はフレーム取得に失敗し、 + * エラーコールバックが発生します。 + * + * 注意:
+ * PS3, Xbox360 でも本関数は使用できますが、とてもCPU負荷の高い関数となります。
+ * 解像度が 1280x720 のムービを本関数をフレーム取得すると1vsync近い時間がかかります。
+ * PS3, Xbox360 ではCriMvEasyPlayer::GetFrameOnTimeAsYUVBuffers() 関数と ピクセルシェーダー + * の組み合わせによるフレーム変換をおすすめします。
+ * + * 備考:
+ * PS2版CRI Movie は本関数に対応していません。 + * + * \sa CriMvEasyPlayer::IsNextFrameOnTime() + */ + CriBool GetFrameOnTimeAs32bitARGB(CriUint8 *imagebuf, CriUint32 pitch, CriUint32 bufsize, CriMvFrameInfo &frameinfo, + CriError &err=CriMv::ErrorContainer); +#endif + +#if !defined(XPT_TGT_EE) + /*EN + * \ingroup MODULE_VIDEO_FRAME + * + * \brief Loads video frame data into a set of Y,U,V separate buffers + * \param yuvbuffers Pointer to Y,U,V buffer data structure + * \param frameinfo Video frame information structure + * \param err Optional error code + * \return TRUE if a frame was retrieved + * \return FALSE otherwise + * + * Copies the next decoded frame into the Y,U,V image buffers pointed to by \a yuvbuffers, for use + * with a pixel shader. CRI Movie decodes video frames into YUV420 format internally, so this is + * a very efficient function. + * + * If the display time is less than the frame time, or if the frame has not yet been decoded, the + * \a frameinfo parameter will be cleared and this function will return FALSE. + * + * To determine if the next frame is ready to be displayed, call CriMvEasyPlayer::IsNextFrameOnTime(). + * + * \remarks + * If the movie does not have an alpha channel, the alpha buffer fields of the \a CriMvYuvBuffers + * structure are not used. + * + * \remarks + * This function is not available on the PS2. + * + * \sa CriMvEasyPlayer::IsNextFrameOnTime() + */ + /*JP + * \ingroup MODULE_VIDEO_FRAME + * \brief YUV個別バッファへのデコード結果の取得 + * \param yuvbuffers YUV個別バッファのパラメータ構造体 + * \param frameinfo 取得したビデオフレームの情報構造体 + * \param err エラー情報(省略可) + * \return フレームが取得できた場合はTRUE(1)、できなかった場合はFALSE(0)を返します。 + * + * YUV個別バッファ形式で表示時刻になっているビデオフレームを取得します。
+ * YUV個別バッファ形式はピクセルシェーダーでフレームを描画するための出力フォーマットです。
+ * この関数を呼び出す場合は、YUV個別バッファの実体を確保したうえで呼び出す必要があります。
+ * ビデオフレームは引数yuvbuffersで指定したYUV個別バッファに書き出されます。
+ * もしも次のビデオフレームの表示時刻になっていなかったり、デコードが終わっていなかった場合は + * フレーム取得できず、frameinfoの中身はクリアされます。
+ * 事前にビデオフレームが取得できるかどうかを知りたい場合は CriMvEasyPlayer::IsNextFrameOnTime() + * を使用してください。
+ *
+ * アルファムービ再生を行わない場合は、引数 yuvbuffers のAlphaテクスチャ関連のパラメータは使用しません。
+ * + * 備考:
+ * PS2版CRI Movie は本関数に対応していません。 + * + * \sa CriMvEasyPlayer::IsNextFrameOnTime() + */ + CriBool GetFrameOnTimeAsYUVBuffers(CriMvYuvBuffers *yuvbuffers, CriMvFrameInfo &frameinfo, + CriError &err=CriMv::ErrorContainer); +#endif + +#if defined(XPT_TGT_PC) || defined(XPT_TGT_SH7269) || defined(XPT_TGT_TRGP6K) + /*EN + * \ingroup MODULE_VIDEO_FRAME + * + * \brief Loads video frame data into a buffer, in YUV422 format + * \param imagebuf Pointer to output buffer + * \param pitch Pitch of output buffer, in bytes + * \param bufsize Size of output buffer, in bytes + * \param frameinfo Video frame information structure + * \param err Optional error code + * \return TRUE if a frame was retrieved + * \return FALSE otherwise + * + * Copies the next decoded frame into the YUV422 texture buffer pointed to by \a imagebuf. + * CRI Movie decodes video frames into YUV420 format internally, so there is some internal conversion + * required when using this function. + * + * If the display time is less than the frame time, or if the frame has not yet been decoded, the + * \a frameinfo parameter will be cleared and this function will return FALSE. + * + * The \a pitch parameter is the width, in bytes, of each row of the frame image, including any padding. + * + * To determine if the next frame is ready to be displayed, call CriMvEasyPlayer::IsNextFrameOnTime(). + * + * \remarks + * This function is currently only available in the PC version of CRI Movie. + * + * \sa CriMvEasyPlayer::IsNextFrameOnTime() + */ + /*JP + * \ingroup MODULE_VIDEO_FRAME + * \brief YUV422フォーマットでのデコード結果の取得 + * \param imagebuf 出力バッファのポインタ + * \param pitch 出力バッファのピッチ [byte] + * \param bufsize 出力バッファサイズ [byte] + * \param frameinfo 取得したビデオフレームの情報構造体 + * \param err エラー情報(省略可) + * \return フレームが取得できた場合はTRUE(1)、できなかった場合はFALSE(0)を返します。 + * + * YUV422テクスチャフォーマットで、表示時刻になっているビデオフレームを取得します。
+ * この関数を呼び出す場合は、YUVバッファの実体を確保したうえで呼び出す必要があります。
+ * ビデオフレームは引数imagebufで指定したYUVバッファに書き出されます。
+ * もしも次のビデオフレームの表示時刻になっていなかったり、デコードが終わっていなかった場合は + * フレーム取得できず、frameinfoの中身はクリアされます。
+ * 事前にビデオフレームが取得できるかどうかを知りたい場合は CriMvEasyPlayer::IsNextFrameOnTime() + * を使用してください。 + * + * 【備考】
+ * 現在は、PC版CRI Movie のみ本関数に対応しています。 + * + * \sa CriMvEasyPlayer::IsNextFrameOnTime() + */ + CriBool GetFrameOnTimeAsYUV422(CriUint8 *imagebuf, CriUint32 pitch, CriUint32 bufsize, CriMvFrameInfo &frameinfo, + CriError &err=CriMv::ErrorContainer); +#endif + +#if defined(XPT_TGT_IPHONE) || defined(XPT_TGT_WINMO) || defined(XPT_TGT_ANDROID) || defined(XPT_TGT_CQSH2A) || defined(XPT_TGT_ACRODEA) || defined(XPT_TGT_NACL) || defined(XPT_TGT_SH7269) || defined(XPT_TGT_PC)|| defined(XPT_TGT_TRGP6K) + /*EN + * \ingroup MODULE_VIDEO_FRAME + * \brief Get video frame data to 16bit RGB565 format buffer + * + * This function is added for a prototype library for iPhone + * Please add comments when releasing the SDK. + * + */ + /*JP + * \ingroup MODULE_VIDEO_FRAME + * \brief 16bit RGB565フォーマットでのデコード結果の取得 + * + * この関数はiPhone版CRI Movieのプロトタイプ用の関数宣言です。 + * SDKとしてリリースする際は、コメントを追加して下さい。 + * + */ + CriBool GetFrameOnTimeAsRGB565(CriUint8 *imagebuf, CriUint32 pitch, CriUint32 bufsize, CriMvFrameInfo &frameinfo, + CriError &err=CriMv::ErrorContainer); +#endif + +#if defined(XPT_TGT_EE) + /*EN + * \ingroup MODULE_VIDEO_FRAME + * + * \brief Gets a reference to EasyPlayer's internal video frame buffer, in 32 bit ARGB format + * \param frameinfo Video frame information structure + * \param err Optional error code + * \return TRUE if a frame was retrieved + * \return FALSE otherwise + * + * Locks the internal buffer for the current video frame in memory, and retrieves a pointer to it. This is + * different behavior than the GetFrameXXX()functions, which copy the frame data into a caller-supplied location. + * + * On successful return from this function, the fields of \a frameinfo will be populated with information + * about the frame. In particular, the \a imageptr field will be set to the image buffer, in 32 bit ARGB format. + * After calling this function, an application must copy the video frame into its own buffer or transfer it to + * GS local memory via DMA. + * + * To determine if the next frame is ready to be displayed, call CriMvEasyPlayer::IsNextFrameOnTime(). + * + * \remarks + * After the application has copied the frame data, it must call CriMvEasyPlayer::UnlockFrame(). + * + * \remarks + * This function is only available on the PS2. + * + * \sa CriMvEasyPlayer::IsNextFrameOnTime(), CriMvEasyPlayer::UnlockFrame() + */ + /*JP + * \ingroup MODULE_VIDEO_FRAME + * \brief デコード結果領域(ARGB32bit)のロック。PS2専用。 + * \param frameinfo ロックしたビデオフレームの情報構造体 + * \param err エラー情報(省略可) + * + * 本関数はPS2専用のフレーム取得関数で、他機種の GetFrame 関数に相当します。
+ * PS2では GetFrame 関数の代わりに本関数と UnlockFrame 関数を使用してフレーム取得を行います。
+ * GetFrame 関数は出力バッファを指定してそこへデコード結果を取得するのに対し、LockFrame 関数はバッファを指定せず + * CriMvEasyPlayerハンドル内部にあるデコード結果バッファのポインタを取得するところが違います。
+ * + * 本関数はデコード結果のメモリ領域を参照開始するためにロックします。
+ * この関数でフレームをロックできるのは、そのフレームが表示可能時間になっている場合のみです。
+ * アプリケーションはフレームをロックしたあと、デコード結果をDMAでテクスチャ領域へ転送するか、 + * 別バッファへコピーするなどの処理を行います。
+ * デコード結果の参照が終わった後には、必ず CriMvEasyPlayer::UnlockFrame() 関数を呼び出して参照終了を通知してください。
+ * + * 備考:
+ * 本関数はPS2版CRI Movie のみ対応しています。 + * + * \sa CriMvEasyPlayer::IsNextFrameOnTime(), CriMvEasyPlayer::UnlockFrame() + */ + CriBool LockFrameOnTimeAs32bitARGB_PS2(CriMvFrameInfo &frameinfo, CriError &err=CriMv::ErrorContainer); +#endif + + /*EN + * \ingroup MODULE_VIDEO_FRAME + * + * \brief Unlocks the video frame + * \param frameinfo Pointer to locked video frame information + * \param err Optional error code + * + * Unlocks the video frame that was locked in memory by a call to one of the LockFrameXXX() functions. + * + * The \a frameinfo parameter must be the same one that was passed to LockFrameXXX(). + * + * If the frame has been locked, EasyPlayer will not be able to retrieve the next frame until the frame is + * unlocked. An attempt to lock the same frame more than once will fail. + * + * The LockFrameXXX() functions are CriMvEasyPlayer::LockFrameOnTimeAs32bitARGB_PS2() and + * CriMvEasyPlayer::LockFrameOnTimeAsYUVBuffers(). Depending on the platform, only one or the other of + * these functions will be available. + * + * \sa CriMvEasyPlayer::LockFrameOnTimeAs32bitARGB_PS2(), CriMvEasyPlayer::LockFrameOnTimeAsYUVBuffers() + */ + /*JP + * \ingroup MODULE_VIDEO_FRAME + * \brief ロックフレームで取得したデコード結果をアンロックする + * \param frameinfo ロックしたビデオフレームの情報構造体 + * \param err エラー情報(省略可) + * + * 本関数はロックフレーム関数を使ってロックしていたフレームをアンロックし、メモリ参照の終了を通知します。
+ * ロックフレーム関数には CriMvEasyPlayer::LockFrameOnTimeAs32bitARGB_PS2() と CriMvEasyPlayer::LockFrameOnTimeAsYUVBuffers() + * がありますが、どちらの関数を使ってロックした場合も、本関数を使ってアンロックします。
+ * 本関数の引数には、どのフレームをアンロックするかを指示するために、ロックフレーム関数で取得したフレーム情報構造体を指定します。
+ * + * 本関数でアンロックしたフレームは、以後、次にビデオフレームのデコード出力バッファとして使用されます。
+ * 1度アンロックしたフレームをもう一度ロックすることは出来ません。
+ * + * \sa CriMvEasyPlayer::LockFrameOnTimeAs32bitARGB_PS2(), CriMvEasyPlayer::LockFrameOnTimeAsYUVBuffers() + */ + CriBool UnlockFrame(CriMvFrameInfo *frameinfo, CriError &err=CriMv::ErrorContainer); + +#if !defined(XPT_TGT_EE) + /*EN + * + * \brief Gets a reference to EasyPlayer's internal video frame buffer + * \param yuvbuffers Y,U,V buffer data structure + * \param frameinfo Video frame information structure + * \param err Optional error code + * \return TRUE if a frame was retrieved + * \return FALSE otherwise + * + * Locks the internal buffer for the current video frame in memory, and retrieves a pointer to it. This is + * different behavior than the GetFrameXXX() functions, which copy the frame data into a caller-supplied location. + * + * On successful return from this function, the fields of \a yuvbuffers will be set to the Y,U,V fields of the + * video frame, and the fields of \a frameinfo will be populated with information about the frame. + * + * After calling this function, an application must copy the video frame into its own buffer or transfer it to + * texture memory. + * + * To determine if the next frame is ready to be displayed, call CriMvEasyPlayer::IsNextFrameOnTime(). + * + * \remarks + * After the application has copied the frame data, it must call CriMvEasyPlayer::UnlockFrame(). + * + * \remarks + * This function is not available on the PS2. + * + * \sa CriMvEasyPlayer::IsNextFrameOnTime(), CriMvEasyPlayer::UnlockFrame() + */ + /*JP + * \ingroup MODULE_VIDEO_FRAME + * \brief デコード結果領域のロック + * \param yuvbuffers YUV個別バッファのパラメータ構造体 + * \param frameinfo ロックしたビデオフレームの情報構造体 + * \param err エラー情報(省略可) + * + * GetFrame とは別の仕様のフレーム取得関数です。
+ * 本関数は UnlockFrame 関数とセットで使用します。
+ * GetFrame 関数は出力バッファを指定してそこへデコード結果を取得するのに対し、LockFrame 関数はバッファを指定せず + * CriMvEasyPlayerハンドル内部にあるデコード結果バッファのポインタを取得するところが違います。
+ * + * 本関数はデコード結果のメモリ領域を参照開始するためにロックし、 + * デコード結果のYUV3種類のバッファについての情報を引数 yuvbuffers に格納します。
+ * この関数でフレームをロックできるのは、そのフレームが表示可能時間になっている場合のみです。
+ * アプリケーションはフレームをロックしたあと、デコード結果をテクスチャ領域へコピーするか、 + * 別バッファへコピーするなどの処理を行います。
+ * デコード結果の参照が終わった後には、必ず CriMvEasyPlayer::UnlockFrame() 関数を呼び出して参照終了を通知してください。
+ * + * 備考:
+ * PS2版CRI Movie は本関数に対応していません。 + * + * \sa CriMvEasyPlayer::UnlockFrame() + */ + CriBool LockFrameOnTimeAsYUVBuffers(CriMvYuvBuffers &yuvbuffers, CriMvFrameInfo &frameinfo, + CriError &err=CriMv::ErrorContainer); +#endif + + /*EN + * \ingroup MODULE_VIDEO_FRAME + * + * \brief Discards the next video frame + * \param frameinfo Discarded frame information structure + * \param err Optional error code + * \return TRUE if a frame was available to discard + * \return FALSE otherwise + * + * Discards the next video frame, if it is available, and populates \a frameinfo with information about + * the frame. Note that the \a imageptr field of that structure will not be available and should not + * be referenced. + * + * To determine if the next frame is ready to be displayed, call CriMvEasyPlayer::IsNextFrameOnTime(). + * + * \sa CriMvEasyPlayer::IsNextFrameOnTime() + */ + /*JP + * \ingroup MODULE_VIDEO_FRAME + * \brief 次フレームを取得せずに捨てる + * \param frameinfo 破棄したビデオフレームの情報構造体 + * \param err エラー情報(省略可) + * + * デコード済みのビデオフレームを捨てたい場合に使用する関数です。
+ * フレーム取得関数と比べると、出力用バッファを準備する必要が無い部分が特徴です。
+ * CriMvEasyPlayer::IsNextFrameOnTime()で次フレームが取得できることを確認した後、本関数を呼び出してください。
+ * 引数frameinfoには参考のために破棄したビデオフレームの情報が格納されますが、デコード結果自体にはアクセスできません。 + * + * \sa CriMvEasyPlayer::IsNextFrameOnTime() + */ + CriBool DiscardNextFrame(CriMvFrameInfo &frameinfo, CriError &err=CriMv::ErrorContainer); + + /*EN + * \ingroup MODULE_OPTION + * + * \brief Sets the current channel for displaying subtitles + * + * \param channel Subtitle channel number + * \param err Optional error code + * + * A movie can contain up to 16 distinct sets of subtitles, each on its own display channel. This can + * be used, for instance, to provide multilanguage support. + * + * Subtitle channels are numbered sequentially, starting from 0, but do not need to be contiguous. + * For example, a movie can have 3 sets of subtitles, on channels 1, 5, and 7. The number of channels + * can be determined once CriMvEasyPlayer::GetMovieInfo() has completed successfully by looking at the + * \a num_subtitle field of the \a CriMvStreamingParameters structure passed to that function. + * + * By default, subtitle playback is off. To turn off subtitles once they have been turned on, pass + * CRIMV_SUBTITLE_CHANNEL_OFF as the value of \a channel. + * + * If the selected subtitle channel does not exist, subtitles will not be displayed. + * + * \remarks + * If an application turns on subtitle display with this function, it must periodically call + * CriMvEasyPlayer::GetSubtitleOnTime(), or else movie playback will stall. + * + * \sa CriMvEasyPlayer::GetMovieInfo(), CriMvEasyPlayer::DecodeHeader(), CriMvEasyPlayer::GetSubtitleOnTime() + */ + /*JP + * \ingroup MODULE_OPTION + * \brief 取得する字幕チャネルの設定 + * \param channel 字幕チャネル + * \param err エラー情報(省略可) + * + * 取得する字幕チャネルを設定します。デフォルトは字幕取得無しです。 + * + * CriMvEasyPlayer::DecodeHeader()と CriMvEasyPlayer::GetMovieInfo()を使うことで、再生するムービが + * いくつの字幕を含んでいるかを再生開始前に知ることができます。 + * + * データが存在しないチャネル番号を指定した場合は、字幕は取得できません。
+ * デフォルト設定(字幕取得無し)にしたい場合は、チャネルとしてCRIMV_SUBTITLE_CHANNEL_OFFを指定してください。 + * + * この関数で字幕チャネルを指定した場合は、メインループから定期的に CriMvEasyPlayer::GetSubtitleOnTime() を + * 実行してください。字幕取得を定期的に行わない場合は、ムービ再生が途中で止まります。 + * + * \sa CriMvEasyPlayer::GetMovieInfo(), CriMvEasyPlayer::DecodeHeader(), CriMvEasyPlayer::GetSubtitleOnTime + */ + void SetSubtitleChannel(CriSint32 channel, CriError &err=CriMv::ErrorContainer); + + /*EN + * \ingroup MODULE_VIDEO_FRAME + * + * \brief Retrieves subtitle data for the current frame, if available + * + * \param bufptr Buffer to receive subtitle data + * \param bufsize Size of buffer, in bytes + * \param err Optional error code + * + * \return The number of bytes copied into \a bufptr + * + * If the movie contains subtitle data, and there is a subtitle for the current frame, up to \a bufsize + * bytes of the subtitle data for the active subtitle channel will be copied into \a bufptr. Otherwise, + * the entire buffer will be filled with zeroes. + * + * \remarks + * If an application turns on subtitle display with CriMvEasyPlayer::SetSubtitleChannel(), it must + * periodically call this function, or else movie playback will stall. + * + * \remarks + * An application should not make assumptions as to whether the returned data is NUL-terminated. + * + * \sa CriMvEasyPlayer::SetSubtitleChannel() + */ + /*JP + * \ingroup MODULE_VIDEO_FRAME + * \brief 字幕データの取得 + * \param bufptr 出力バッファポインタ + * \param bufsize 出力バッファサイズ [byte] + * \param err エラー情報(省略可) + * \return 取得した字幕データのサイズ[byte]を返します。 + * + * 表示時刻になっている字幕データを取得します。 + * この関数を呼び出す場合は、字幕用バッファの実体を確保したうえで呼び出してください。
+ * 字幕データは引数 bufptr で指定したバッファに書き出されます。
+ * もし字幕データが bufsize よりも大きい場合は、bufsize に収まる量だけ書き出し、残りは破棄されます。 + * + * もしも表示時刻の字幕が無い場合は、バッファの中身はクリアされます。 + * + * CriMvEasyPlayer::SetSubtitleChannel()で存在する字幕チャネルを指定している場合は、 + * メインループから定期的に本関数を実行してください。
+ * 実行しない場合は、ムービ再生が途中で止まります。 + * + * \sa CriMvEasyPlayer::SetSubtitleChannel() + */ + CriUint32 GetSubtitleOnTime(CriUint8 *bufptr, CriUint32 bufsize, CriError &err=CriMv::ErrorContainer); + + /*EN + * \ingroup MODULE_OPTION + * + * \brief Sets a secondary sound interface + * + * \param sound Secondary sound interface to attach to this handle + * \param err Optional error code + * + * A subaudio interface allows an application to play two audio tracks at the same time. This is + * typically used to play a dialog track or sound effects along with background music. After calling + * this function, an application needs to call CriMvEasyPlayer::SetSubAudioTrack() to choose the secondary + * audio track to play. + * + * Note that you must create a separate sound interface to pass to this function. The interface used + * in the CriMvEasyPlayer::Create() call can not be used. + * + * If a subaudio interface is used, the application must call CriMvEasyPlayer::DetachSubAudioInterface() + * when the EasyPlayer handle reaches the MVEASY_STATUS_STOP or MVEASY_STATUS_PLAYEND state before calling + * CriMvEasyPlayer::Destroy(). + * + * Calling CriMvEasyPlayer::ResetAllParameters() will not affect the value set by this function. + * + * \remarks + * If this function is called, it must be called before starting playback (with either CriMvEasyPlayer::Prepare() + * or CriMvEasyPlayer::Start()). + * + * \remarks + * An EasyPlayer handle can not use a subaudio interface and center channel replacement (see + * CriMvEasyPlayer::ReplaceCenterVoice()) at the same time. + * + * \sa CriMvEasyPlayer::DetachSubAudioInterface(), CriMvEasyPlayer::SetSubAudioTrack(), + * CriMvEasyPlayer::ReplaceCenterVoice() + */ + /*JP + * \ingroup MODULE_OPTION + * \brief サブオーディオ用サウンドインタフェースの設定 + * \param sound サブオーディオ用サウンドインタフェース + * \param err エラー情報(省略可) + * + * サブオーディオ(メインオーディオと同時に別のオーディオを再生する機能)のための + * サウンドインタフェースを設定します。
+ * 設定するサウンドインタフェースは、 CriMvEasyPlayer::Create() 時に指定したサウンドインタフェース + * とは「別の」インスタンスでなければいけません。
+ * + * 本関数は、EasyPlayerハンドル作成後、 CriMvEasyPlayer::Start() または CriMvEasyPlayer::Prepare() の + * 呼び出しより前に実行しなければいけません。
+ * + * サブオーディオを再生するには、本関数でサウンドインタフェースを設定したあと、 + * CriMvEasyPlayer::SetSubAudioTrack() でサブオーディオのトラックを指定してください。
+ * + * サブオーディオ用サウンドインタフェースを設定したハンドル破棄を破棄する前に、 + * MVEASY_STATUS_STOP または MVEASY_STATUS_PLAYEND の状態で CriMvEasyPlayer::DetachSubAudioInterface() を呼んでください。 + * なお、サブオーディオ用サウンドインタフェースは CriMvEasyPlayer::ResetAllParameters() を呼び出してもリセットされません。 + * + * 注意:
+ * サブオーディオ機能は、 CriMvEasyPlayer::ReplaceCenterVoice() によるセンターチャネル置き換え機能とは + * 同時に使用できません。
+ * + * \sa CriMvEasyPlayer::DetachSubAudioInterface(), CriMvEasyPlayer::SetSubAudioTrack(), + * CriMvEasyPlayer::ReplaceCenterVoice() + */ + void AttachSubAudioInterface(CriMvSoundInterface *sound, CriError &err=CriMv::ErrorContainer); + + /*EN + * \ingroup MODULE_OPTION + * + * \brief Removes a secondary audio interface + * + * \param err Optional error code + * + * Removes the secondary sound interface that was set by a call to CriMvEasyPlayer::AttachSubAudioInterface(). + * + * This function should be called when the EasyPlayer handle's state is either MVEASY_STATUS_STOP or + * MVEASY_STATUS_PLAYEND. + * + * \sa CriMvEasyPlayer::AttachSubAudioInterface() + */ + /*JP + * \ingroup MODULE_OPTION + * \brief サブオーディオ用サウンドインタフェースの解除 + * \param err エラー情報(省略可) + * + * 現在設定されているサブオーディオ用サウンドインタフェースを解除します。
+ * + * 本関数は、EasyPlayerハンドルの状態が CriMvEasyPlayer::MVEASY_STATUS_STOP または + * CriMvEasyPlayer::MVEASY_STATUS_PLAYEND の時に呼び出してください。
+ * + * \sa CriMvEasyPlayer::AttachSubAudioInterface() + */ + void DetachSubAudioInterface(CriError &err=CriMv::ErrorContainer); + + /*EN + * \ingroup MODULE_OPTION + * + * \brief Sets the secondary audio track + * + * \param track Track number + * \param err Optional error code + * + * A secondary, or subaudio, track is typically used to play a dialog track or sound effects along + * with a movie. An application can support several different languages by setting the desired language + * track with this function. By default, the subaudio track is disabled, even if the interface has been set. + * + * Subaudio is enabled with CriMvEasyPlayer::AttachSubAudioInterface(). If the interface has not been set, + * this function will have no effect. + * + * The main audio track for the movie is set with CriMvEasyPlayer::SetAudioTrack(). If the same track + * number is used for the main and subaudio, the subaudio will not play. + * + * To turn off the subaudio track, pass CRIMV_CENTER_VOICE_OFF as the track number. + * + * \remarks + * If this function is called, it must be called before starting playback (with either CriMvEasyPlayer::Prepare() + * or CriMvEasyPlayer::Start()). + * + * \remarks + * An EasyPlayer handle can not use a subaudio interface and center channel replacement (see + * CriMvEasyPlayer::ReplaceCenterVoice()) at the same time. + * + * \sa CriMvEasyPlayer::AttachSubAudioInterface(), CriMvEasyPlayer::ReplaceCenterVoice() + */ + /*JP + * \ingroup MODULE_OPTION + * \brief サブオーディオトラックの設定 + * \param track サブオーディオ再生するトラック番号 + * \param err エラー情報(省略可) + * + * サブオーディオトラックを設定します。デフォルト値は CRIMV_CENTER_VOICE_OFF です。
+ * + * サブオーディオを再生するには、 CriMvEasyPlayer::AttachSubAudioInterface() でサウンドインタフェースを設定したあと、 + * 本関数でサブオーディオのトラックを指定してください。
+ * 本関数の呼び出しは、 CriMvEasyPlayer::Start() または CriMvEasyPlayer::Prepare() の呼び出しより前でなければいけません。
+ * + * メインオーディオのトラックは CriMvEasyPlayer::SetAudioTrack() で指定します。 + * サブオーディオトラックとしてメインオーディオと同じトラックを指定した場合は、サブオーディオからは何も再生されません。
+ * + * サブオーディオトラックには、センターチャネル置き換え機能とは異なりチャネル数の制限はありません。 + * モノラル、ステレオ、5.1ch のいずれのトラックもサブオーディオとして使用することができます。
+ * + * 注意:
+ * サブオーディオ機能は、 CriMvEasyPlayer::ReplaceCenterVoice() によるセンターチャネル置き換え機能とは + * 同時に使用できません。
+ * + * \sa CriMvEasyPlayer::AttachSubAudioInterface() + */ + // default value is -1. + void SetSubAudioTrack(CriSint32 track, CriError &err=CriMv::ErrorContainer); + + /*EN + * \ingroup MODULE_OPTION + * + * \brief Retrieves the secondary audio track + * + * \param err Optional error code + * \return track number Current subaudio track number + * + * When you successfully set the subaudio track, this function return the track number + * that you specified by CriMvEasyPlayer::SetSubAudioTrack(). Otherwise, it retuns CRIMV_CENTER_VOICE_OFF. + * + * \sa CriMvEasyPlayer::SetSubAudioTrack() + */ + /*JP + * \ingroup MODULE_OPTION + * \brief サブオーディオトラックの取得 + * \param err エラー情報(省略可) + * \return トラック番号 現在設定されているトラック番号 + * + * サブオーディオ再生が有効になっていれば、ユーザがCriMvEasyPlayer::SetSubAudioTrack()で設定した + * サブオーディオトラック番号を返します。 + * + * サブオーディオ再生が有効でない場合や、サブオーディオトラックを指定していなかった場合は、 + * CRIMV_CENTER_VOICE_OFFを返します。 + * + * \sa CriMvEasyPlayer::SetSubAudioTrack() + */ + CriSint32 GetSubAudioTrack(CriError &err=CriMv::ErrorContainer); + + /*EN + * \ingroup MODULE_OPTION + * + * \brief Replaces the center channel of a 5.1ch audio track + * + * \param track Track number to use + * \param err Optional error code + * + * If the current audio track for a movie (set with CriMvEasyPlayer::SetAudioTrack()) is in 5.1ch + * surround sound, the center channel can be replaced with a different, mono, track. This does not + * affect any of the other channels in the 5.1ch track. + * + * If the current audio track is not 5.1ch, or the replacement track is not monaural, this call will + * have no effect. + * + * Passing CRIMV_CENTER_VOICE_OFF as the value of \a track will undo the replacement and revert to + * playing the original center channel of th 5.1ch track. + * + * \remarks + * An EasyPlayer handle can not use center channel replacement and a subaudio interface (see + * CriMvEasyPlayer::AttachSubAudioInterface() and CriMvEasyPlayer::SetSubAudioTrack()) at the same time. + * + * \sa CriMvEasyPlayer::SetAudioTrack(), CriMvEasyPlayer::AttachSubAudioInterface(), + * CriMvEasyPlayer::SetSubAudioTrack() + */ + /*JP + * \ingroup MODULE_OPTION + * \brief センターボイスの設定 + * \param track ボイストラック番号 + * \param err エラー情報(省略可) + * + * 5.1ch オーディオ再生時に、センターチャネルだけを別のモノラルトラックと置き換えることができます。
+ * 本関数は、置き換え用のモノラルデータが入ったオーディオトラックを設定します。
+ * 5.1ch BGM に対して、ボイスだけを複数種類から差し替えたい場合に使用してください。 + * + * デフォルトはセンターボイス指定無しです。 + * + * この関数を使用した場合、メインのオーディオトラックとして再生している5.1chデータのセンターチャネル + * は破棄され、代わりにセンターボイスとして指定したデータが入ります。 + * + * (a) センターボイスとして使用できるのはモノラルのオーディオだけです。
+ * (b) センター置き換えが有効なのはメインのオーディオが5.1chの場合だけです。 + * + * この二つの条件を満たしていない場合は、本関数で設定した値は無視されます。 + * + * デフォルト値に戻したい場合は、チャネルとしてCRIMV_CENTER_VOICE_OFFを指定してください。 + * + * \sa CriMvEasyPlayer::SetAudioTrack(), CriMvEasyPlayer::AttachSubAudioInterface(), + * CriMvEasyPlayer::SetSubAudioTrack() + */ + void ReplaceCenterVoice(CriSint32 track, CriError &err=CriMv::ErrorContainer); + + /*EN + * \ingroup MODULE_OPTION + * + * \brief Sets a callback function that will set the movie file + * + * \param func Callback function + * \param usrobj Pointer to user-provided data + * \param err Optional error code + * + * Normally, the movie file is provided directly, via CriMvEasyPlayer::SetFile() or + * CriMvEasyPlayer::SetData(), before playback is started. Setting a file request callback + * allows an application to do \a concatenated \a playback, playing multiple movies, one + * after the other. + * + * If the callback function is set, it will be called when + * + * - The last data chunk of the current movie has been read by EasyPlayer. + * - Any of the playback functions (CriMvEasyPlayer::Start(), CriMvEasyPlayer::Prepare(), + * or CriMvEasyPlayer::DecodeHeader()) are called and the movie file has not been set. + * + * The callback should call CriMvEasyPlayer::SetFile() or CriMvEasyPlayer::SetData() if the + * application wants to continue playback. Otherwise, playback will end once the callback returns. + * + * The \a usrobj parameter specifies a pointer to arbitrary data, that will be passed as the + * second parameter to the callback. + * + * The prototype of the callback function is + * + * void callback(CriMvEasyPlayer *mveasy, void *usrobj) + * + * where + * + * mveasy is the EasyPlayer object + * usrobj is the pointer to user data that was passed to SetFileRequestCallback(). + * + * \remarks + * In order to do concatenated playback, all movies must have the same + * + * \remarks + * - video resolution + * - framerate + * - video codec + * - audio track structure + * - subtitle structure + * + * \remarks + * The same audio track structure means that all movies must have the same number of tracks, and the + * same track number must be of the same audio type for each movie. For instance, if the first movie has + * 2 audio tracks, with track 1 being stereo and track 2 being mono, then \a all other movies would have + * to have 2 tracks, track 1 stereo and track 2 mono. + * + * \remarks + * Subtitles have to match in the number of channels. For instance, if the first movie had 3 subtitle + * channels, then all other movies would need 3 channels. It is also important to keep the languages on + * the same tracks for each movie, since otherwise the application would get confused. CRI Movie makes + * no assumptions about languages or the interpretation of subtitles; subtitles are simply treated as + * binary data. + * + * \remarks + * Currently, cuepoints are not supported with concatenated playback. + * + * \sa CriMvEasyPlayer::SetFile(), CriMvEasyPlayer::SetData() + */ + /*JP + * \ingroup MODULE_OPTION + * \brief ファイル要求コールバック関数の登録 + * \param func ファイル要求コールバック関数 + * \param usrobj ユーザオブジェクト + * \param err エラー情報(省略可) + * + * ムービの連結再生を行うために、ムービファイルを要求するコールバック関数を登録します。 + * このコールバック関数は以下のタイミングで発生します。 + * + * ・ムービファイルを読み込み終了した時。
+ * ・ファイルの指定無しで再生を開始した時。 + * + * ファイル要求コールバック関数内で CriMvEasyPlayer::SetFile() または CriMvEasyPlayer::SetData() + * を呼び出すことで、連続して次のムービファイルを指定することができます。
+ * SetFile() も SetData() も呼び出さなかった場合は、読み込み済みのムービが終わると + * 再生終了になります。 + * + * ファイル要求コールバック発生時、コールバック関数の第二引数usrobjには、登録時に指定 + * したユーザオブジェクトが渡されます。登録ファイルリストなどの管理に利用してください。 + * + * 連結再生できるムービファイルには以下の条件があります。
+ * - ビデオ解像度が同じ + * - ビデオのフレームレートが同じ + * - ビデオのコーデックが同じ + * - オーディオおよび字幕のトラック構成が同じ + * + * \sa CriMvEasyPlayer::SetFile(), CriMvEasyPlayer::SetData() + */ + void SetFileRequestCallback(void (*func)(CriMvEasyPlayer *mveasy, void *usrobj), + void *usrobj, CriError &err=CriMv::ErrorContainer); + +#if defined(XPT_TGT_PC) + /*EN + * \ingroup MODULE_OPTION + * \brief Set processor parameters for decoding on PC + * + * \param num_threads Number of additional threads for load distribution in decoding (Maximum 3 threads) + * \param affinity_mask Pointer to an array of thread affinity masks for each thread specified with num_threads. + * \param priority Thread priority of the decoding threads for load balancing + * \param err Optional error code + * + * This function sets the processor parameters for decoding. Use it when you want to change + * processors or thread priority for decoding load distribution. + * + * If this function is called, it must be called before calling any of the playback functions + * (CriMvEasyPlayer::Start(), CriMvEasyPlayer::Prepare(), or CriMvEasyPlayer::DecodeHeader()). + * + * On initialization, CRI Movie prepares three worker threads for distributed decoding.
+ * + * \a num_threads specifies how many worker threads CRI Movie should use.
+ * \a affinity_mask is an array of affinity masks for the worker threads. This array must have + * \a num_threads many elements. The format of \a affinity_mask is same as for the value passed to the + * Win32 SetThreadAffinityMask() API function.
+ * \a priority is used as the thread priority for all of the threads specified by \a num_threads. + * + * If this function is called, three distributed decoding threads will run in parallel by default. + * Also, processor assignment of the decoding threads is handled by the operating system, and their + * priority will be normal. + * + * To reset the parameters, call this function again, passing CRIMV_DEFAULT_AFFNITY_MASK_PC and + * CRIMV_DEFAULT_THREAD_PRIORITY_PC as the affinity masks and thread priority. + * + * \sa CRIMV_DEFAULT_AFFNITY_MASK_PC, CRIMV_DEFAULT_THREAD_PRIORITY_PC + */ + /*JP + * \ingroup MODULE_OPTION + * \brief PCでデコード処理に使う追加プロセッサ設定 + * \param num_threads 負荷分散デコード用に使用する追加スレッドの数 (最大3つ) + * \param affinity_masks スレッドアフィニティマスクの配列へのポインタ。num_threadsで指定したスレッドごとのマスク値。 + * \param priority 負荷分散デコードスレッドの優先度 + * \param err エラー情報(省略可) + * + * デコード処理を分散して処理するためのプロセッサを指定できます。 + * デコード処理に行うプロセッサやスレッド優先度を変更したい場合に使用してください。 + * 本関数は再生開始(Start, Prepare, DecodeHader)前に呼び出す必要があります。 + * + * CRI Movieは初期化の際に3つの分散デコード用のワーカースレッドを用意します。 + * num_threads引数で、そのうちのいくつのスレッドを実際に使用するかを指定できます。 + * アプリケーションから明示的にプロセッサ割り当てを行いたい場合、個々のスレッドに対して + * アフィニティマスクを設定してください。 + * アフィニティマスクの値は、Win32 APIのSetThreadAffinityMaskの引数と同じ書式です。 + * スレッド優先度は、num_threadsで指定したデコードに使用するスレッドに対して適用されます。 + * + * この関数を呼ばなかった場合、3つのスレッドで並列デコードを行います。 + * デコードスレッドのプロセッサは割り当ては全てOS任せで、優先度はスレッド標準になります。 + * + * 一度本関数で設定を変更した後、状態を戻したい場合は、CRIMV_DEFAULT_AFFNITY_MASK_PC, CRIMV_DEFAULT_THREAD_PRIORITY_PCを + * 引数として指定し、再度呼び出してください。 + * + * \sa CRIMV_DEFAULT_AFFNITY_MASK_PC, CRIMV_DEFAULT_THREAD_PRIORITY_PC + */ + void SetUsableProcessors_PC(CriSint32 num_threads, const CriUint32 *affinity_mask, CriSint32 priority, + CriError &err=CriMv::ErrorContainer); + +#endif + +#if defined(XPT_TGT_XBOX360) + /*EN + * \ingroup MODULE_OPTION + * \brief Set processor parameters for decoding + * \param processors_param Processor Parameters + * \param err Optional error code + * + * \brief Set processor parameters for decoding + * \param processors_param Processor Parameters + * \param err Optional error code + * + * This function sets the processor parameters for decoding, along the priority of the + * decoding threads. + * + * If this function is called, it must be called before calling any of the playback functions + * (CriMvEasyPlayer::Start(), CriMvEasyPlayer::Prepare(), or CriMvEasyPlayer::DecodeHeader()). + * + * If you don't call this function, the EasyPlayer handle uses Processor 3 (Core 0, Thread 0) + * and Processor 5 (Core 0, Thread 0). + * + * \sa CriMvProcessorParameters_XBOX360 + */ + /*JP + * \ingroup MODULE_OPTION + * \brief Xbox360でデコードに使うプロセッサ設定 + * \param processors_param 使用プロセッサパラメータ + * \param err エラー情報(省略可) + * + * デコードに使用するプロセッサを指定します。
+ * 本関数は再生開始(Start, Prepare, DecodeHader)前に呼び出す必要があります。 + * + * また、デコードに使用する内部スレッドの優先度の設定が出来ます。 + * + * デフォルトのプロセッサ設定では、プロセッサ3(コア1スレッド1)とプロセッサ5 + * (コア2スレッド1)を使用します。 + * + * \sa CriMvProcessorParameters_XBOX360 + */ + void SetUsableProcessors_XBOX360(const CriMvProcessorParameters_XBOX360 *processors_param, + CriError &err=CriMv::ErrorContainer); +#endif + + /*EN + * \ingroup MODULE_OPTION + * + * \brief Sets the frame where playback will start + * + * \param seek_frame_id Frame (0-based) to start playing from + * \param err Optional error code + * + * To play a movie from other than the first frame, call this function before starting playback. + * To seek to a new frame when the movie is already playing, call CriMvEasyPlayer::Stop() and wait + * for the handle to change to the MVEASY_STATUS_STOP state, call this function with the desired + * frame number, then call CriMvEasyPlayer::Start() again. + * + * Valid values for seek_frame_id are from 0 to \a num_frames - 1, where \a num_frames can be found by + * + *
+	 *
+	 *   CriMvStreamingParameters streaming_params;
+	 *   CriSint32                num_frames;
+	 *
+	 *   GetMovieInfo(streaming_params);
+	 *   num_frames = streaming_params.video_prm[0].total_frames;
+	 *
+	 * 
+ * + * Refer to \ref usr_mech7 for more information. + * + * \remarks + * If the value of \a seek_frame_id is out of range, playback will start from frame 0. + * + * \sa CriMvStreamingParameters + */ + /*JP + * \ingroup MODULE_OPTION + * \brief シーク再生開始位置の設定 + * \param seek_frame_id シーク再生開始するフレーム番号(0〜) + * \param err エラー情報(省略可) + * + * シーク再生を開始するフレーム番号を指定します。 + * + * 再生開始前( CriMvEasyPlayer::Prepare()または CriMvEasyPlayer::Start()呼び出し前)に本関数を実行してください。 + * また、この関数はムービの再生中に呼び出すことは出来ません。再生中にシークをする場合は、一度再生を停止してから + * 本関数を呼び出してください。 + * + * 本関数を実行しなかった場合、またはフレーム番号0を指定した場合はムービの先頭から再生を開始します。 + * 指定したフレーム番号が、ムービデータの総フレーム数より大きかったり負の値だった場合もムービの先頭から再生します。 + * + * \ref usr_mech7 もあわせて参照してください。 + * + */ + void SetSeekPosition(CriSint32 seek_frame_id, CriError &err=CriMv::ErrorContainer); + + /*EN + * + * \brief Calculates a frame ID from a frame time + * + * \param count Timer counter + * \param unit Counter increment per second + * \param err Optional error code + * + * \return Frame ID corresponding to given time + * + * Each frame of a movie corresponds to a particular display time, based on the framerate. Given a + * time from the start of playback, this function will return the ID of the specific frame that should + * be displayed, barring any delays or skipped frames, at that time. + * + * The time, in seconds, is specified by \a count / \a unit.
+ * + * This function can be used for, among other things, jumping to a particular frame when a cuepoint is reached. + * + * \remarks + * This function can be called once the EasyPlayer handle status has reached MVEASY_STATUS_WAIT_PREP. + * + * \sa CriMvEasyPlayer::CalcTimeFromFrameId(); + */ + /*JP + * \ingroup MODULE_OPTION + * \brief 再生時刻からフレーム番号の計算 + * \param count タイマカウント + * \param unit 1秒あたりのタイマカウント値。count ÷ unit で秒単位の時刻となります。 + * \param err エラー情報(省略可) + * \return frame ID + * + * 再生時刻からフレーム番号を計算します。 + * この関数は、EasyPlayerハンドルの状態が MVEASY_STATUS_WAIT_PREP 以降になったあとに使用できます。 + * + * シーク再生開始位置を、時刻から計算したいときに使用してください。 + * (例えばキューポイント情報からシーク位置を決定する場合など。) + * + * \sa CriMvEasyPlayer::CalcTimeFromFrameId(); + */ + CriSint32 CalcFrameIdFromTime(CriUint64 count, CriUint64 unit, CriError &err=CriMv::ErrorContainer); + + /*EN + * \ingroup MODULE_OPTION + * + * \brief Calculates a frame time from a frame ID + * + * \param frame_id Frame ID + * \param unit Counter increment per second + * \param err Optional error code + * + * \return Timer counter corresponding to given frame ID + * + * Each frame of a movie corresponds to a particular display time, based on the framerate. Given a + * frame ID and the number of timer intervals per second, this function will return the timer count + * of the display time for that frame. + * + * The display time, in seconds, for this frame is calculated by dividing the timer count by the timer + * interval. + * + * If you have the movie frame, you do not have to calculate the time. The \a time and \a tunit fields + * of the CriMvFrameInfo structure that is passed the GetFrameOnTimeXXX() and DiscardNextFrame() + * functions will contain this information. + * + * \remarks + * This function can be called once the EasyPlayer handle status has reached MVEASY_STATUS_WAIT_PREP. + * + * \sa CriMvEasyPlayer::CalcFrameIdFromTime(), CriMvFrameInfo + */ + /*JP + * \ingroup MODULE_OPTION + * \brief フレーム番号から再生時刻の計算 + * \param frame_id frame ID + * \param unit 1秒あたりのタイマカウント値。count ÷ unit で秒単位の時刻となります。 + * \param err エラー情報(省略可) + * \return タイマカウント + * + * フレーム番号から再生時刻を計算します。 + * この関数は、EasyPlayerハンドルの状態が MVEASY_STATUS_WAIT_PREP 以降になったあとに使用できます。 + * + * 実際にフレーム取得した場合は、計算の必要はありません。フレーム情報構造体の時刻を参照してください。 + * + * \sa CriMvEasyPlayer::CalcFrameIdFromTime(), CriMvFrameInfo + */ + CriUint64 CalcTimeFromFrameId(CriSint32 frame_id, CriUint64 unit, CriError &err=CriMv::ErrorContainer); + + /*EN + * \ingroup MODULE_OPTION + * + * \brief Find the next event point, if any, after the given time counter + * + * \param count Timer counter + * \param unit Counter increment per second + * \param type Type of event point to look for + * \param eventinfo Returned event point information structure + * \param err Optional error code + * + * \return Frame ID corresponding to given time + * + * Event points allow an application to associate arbitrary actions with specific points in a movie. + * This function will search forward in the movie for the next event point after the given time + * (specifed as \a count / \a unit). If an event point is found, \a eventinfo will be populated with + * the information about the event point, and the function will return the corresponding frame ID. + * + * \a type is an application-defined value that can be used to categorize event points, and is specified + * when the movie is encoded (see link to event-point-specification-section for more information + * about creating event points.). If -1 is passed as the value of \a type, all event points will be + * searched. Otherwise, only matching event point types will be searched. + * + * If no event point of the requested type is found, this function will return -1. + * + * \remarks + * This function can be called once the EasyPlayer handle status has reached MVEASY_STATUS_WAIT_PREP. + * + * \sa CriMvEasyPlayer::SearchPrevEventPointByTime(); + */ + /*JP + * \ingroup MODULE_OPTION + * \brief 指定時刻直後のイベントポイントの検索 + * \param count タイマカウント + * \param unit 1秒あたりのタイマカウント値。count ÷ unit で秒単位の時刻となります。 + * \param type 検索対象とするイベントポイントのtype値 + * \param eventinfo 発見したイベントポイントの情報 + * \param err エラー情報(省略可) + * \return frame ID + * + * 指定時刻の次にあるイベントポイントを検索し、イベントポイント情報とフレーム番号を取得します。 + * この関数は、EasyPlayerハンドルの状態が MVEASY_STATUS_WAIT_PREP 以降になったあとに使用できます。 + * + * 検索の対象となるのは type で指定した値が一致するイベントポイントです。 + * type に -1を指定した場合は、全てのイベントポイントが検索対象となります。 + * + * 検索対象となるイベントポイントが発見できなかった場合は、フレーム番号は-1を返します。 + * + * \sa CriMvEasyPlayer::SearchPrevEventPointByTime(); + */ + CriSint32 SearchNextEventPointByTime(CriUint64 count, CriUint64 unit, CriSint32 type, + CriMvEventPoint &eventinfo, CriError &err=CriMv::ErrorContainer); + + /*EN + * \ingroup MODULE_OPTION + * + * \brief Find the previous event point, if any, before the given time counter + * + * \param count Timer counter + * \param unit Counter increment per second + * \param type Type of event point to look for + * \param eventinfo Returned event point information structure + * \param err Optional error code + * + * \return Frame ID corresponding to given time + * + * Event points allow an application to associate arbitrary actions with specific points in a movie. + * This function will search backward in the movie (i.e. towards the beginning) for the next event + * point before the given time (specifed as \a count / \a unit). If an event point is found, + * \a eventinfo will be populated with the information about the event point, and the function will + * return the corresponding frame ID. + * + * \a type is an application-defined value that can be used to categorize event points, and is specified + * when the movie is encoded (see link to event-point-specification-section for more information + * about creating event points.). If -1 is passed as the value of \a type, all event points will be + * searched. Otherwise, only matching event point types will be searched. + * + * If no event point of the requested type is found, this function will return -1. + * + * \remarks + * This function can be called once the EasyPlayer handle status has reached MVEASY_STATUS_WAIT_PREP. + * + * \sa CriMvEasyPlayer::SearchNextEventPointByTime(); + */ + /*JP + * \ingroup MODULE_OPTION + * \brief 指定時刻直前のイベントポイントの検索 + * \param count タイマカウント + * \param unit 1秒あたりのタイマカウント値。count ÷ unit で秒単位の時刻となります。 + * \param type 検索対象とするイベントポイントのtype値 + * \param eventinfo 発見したイベントポイントの情報 + * \param err エラー情報(省略可) + * \return frame ID + * + * 指定時刻の手前にあるイベントポイントを検索し、イベントポイント情報とフレーム番号を取得します。 + * この関数は、EasyPlayerハンドルの状態が MVEASY_STATUS_WAIT_PREP 以降になったあとに使用できます。 + * + * 検索の対象となるのは type で指定した値が一致するイベントポイントです。 + * type に -1を指定した場合は、全てのイベントポイントが検索対象となります。 + * + * 検索対象となるイベントポイントが発見できなかった場合は、フレーム番号は-1を返します。 + * + * \sa CriMvEasyPlayer::SearchNextEventPointByTime(); + */ + CriSint32 SearchPrevEventPointByTime(CriUint64 count, CriUint64 unit, CriSint32 type, + CriMvEventPoint &eventinfo, CriError &err=CriMv::ErrorContainer); + + /*EN + * \ingroup MODULE_OPTION + * + * \brief Gets the list of all event points in the movie + * + * \param err Optional error code + * + * \return Pointer to the list of event points, or NULL if there are no event points + * + * CRI Movie considers a cue point list to be the number of event points in a movie, and a pointer to + * an array of event point structures. Event points allow an application to associate arbitrary actions + * with specific points in a movie. + * + * The returned pointer points to an area inside of the EasyPlayer's work buffer. An application should + * not attempt to write to it. + * + * \remarks + * This function can be called once the EasyPlayer handle status has reached MVEASY_STATUS_WAIT_PREP. + * The returned information is valid through the MVEASY_STATUS_STOP state. Once the EasyPlayer handle + * has been destroyed, or the movie has been restarted (by calling CriMvEasyPlayer::Start(), + * CriMvEasyPlayer::Prepare(), or CriMvEasyPlayer::DecodeHeader()), the cuepoint information will be + * invalid. + * + */ + /*JP + * \ingroup MODULE_OPTION + * \brief キューポイント情報(イベントポイント一覧)の取得 + * \param err エラー情報(省略可) + * \return Cue point info (Event point list) + * + * キューポイント情報(イベントポイント一覧)を取得します。 + * この関数は、EasyPlayerハンドルの状態が MVEASY_STATUS_WAIT_PREP 以降になったあとに使用できます。 + * + * この関数で取得するキューポイント情報は、再生ハンドルのワークバッファを直接参照しています。
+ * 再生停止状態での参照は可能ですが、次の再生を開始した後は参照を禁止します。
+ * このキューポイント情報を別のメモリにコピーした場合もこの条件は変わりません。 + * + */ + CriMvCuePointInfo* GetCuePointInfo(CriError &err=CriMv::ErrorContainer); + + /*EN + * \ingroup MODULE_OPTION + * + * \brief Sets a function that will be called when a cue point is reached + * + * \param func Callback function + * \param usrobj Pointer to user-provided data + * \param err Optional error code + * + * Beginning with version 2.0, CRI Movie allows a movie to specify arbitrary actions to + * happen at various points on the timeline. These are referred to as \a cue \a points, or, + * more generally, as \a event \a points. If a cue point callback has been installed for the + * movie, it will be called whenever a cuepoint has been reached. + * + * The \a usrobj parameter specifies a pointer to arbitrary data, that will be passed as the + * third parameter to the callback. + * + * The prototype of the callback function is + * + * void callback(CriMvEasyPlayer *mveasy, CriMvEventPoint *eventinfo, void *usrobj) + * + * where + * + * mveasy is the EasyPlayer object
+ * eventinfo is the event info structure that was reached
+ * usrobj is the pointer to user data that was passed to SetFileRequestCallback().
+ * + * \remarks + * Do not call any movie playback functions (for example, CriMvEasyPlayer::Stop()) from the callback + * function. If you need to do this, set a flag from the callback and refer to it in your main loop. + * + * \sa CriMvEventPoint + */ + /*JP + * \ingroup MODULE_OPTION + * \brief キューポイントコールバック関数の登録 + * \param func キューポイントコールバック関数 + * \param usrobj ユーザオブジェクト + * \param err エラー情報(省略可) + * + * キューポイントのコールバック関数を登録します。 + * このコールバック関数は、ムービの再生時刻が各イベントポイントで指定された時刻を経過した時に発生します。 + * コールバック関数の呼び出し判定は CriMvEasyPlayer::Update() から行われます。 + * + * キューポイントコールバック発生時、コールバック関数の第2引数 eventinfo にはエベントポイント情報が、 + * 第3引数usrobjには、登録時に指定したユーザオブジェクトが渡されます。 + * + * キューポイントコールバック関数内では、ムービ再生をコントロールする関数(例えば CriMvEasyPlayer::Stop()) + * を呼び出してはいけません。 + * + * \sa CriMvEventPoint + */ + void SetCuePointCallback(void (*func)(CriMvEasyPlayer *mveasy, CriMvEventPoint *eventinfo, void *usrobj), + void *usrobj, CriError &err=CriMv::ErrorContainer); + + + /*EN + * \ingroup MODULE_OPTION + * + * \brief Resets movie handle parameters to their default values + * + * \param err Optional error code + * + * This function will reset most parameters back to their default values. Call this when you are + * reusing an EasyPlayer handle and need to quickly undo changes to a number of parameters. + * + * Note that this will not remove a subaudio interface (set by CriMvEasyPlayer::AttachSubAudioInterface()). + * CriMvEasyPlayer::DetachSubAudioInterface() must be called instead. + * + * \remarks + * This function can be called once the EasyPlayer handle status is either MVEASY_STATUS_STOP or + * MVEASY_STATUS_PLAYEND. + * + * + *
Setting API Reset by ResetAllParameters() Reset by Stop() + *
SetFile YES (*1) + *
SetData YES (*1) + *
Pause YES YES + *
SetMasterTimer YES NO + *
SetNumberOfFramePools YES NO + *
SetBufferingTime YES NO + *
SetReloadThresholdTime YES NO + *
SetMaxBitrate YES NO + *
SetAudioTrack YES NO + *
SetLoopFlag YES NO + *
SetStreamingParameters YES NO + *
AttachSubAudioInterface NO NO + *
SetSubAudioTrack YES NO + *
ReplaceCenterVoice YES NO + *
SetFileRequestCallback YES NO + *
SetSeekPosition YES NO + *
SetCuePointCallback YES NO + *
+ * + * (*1) Normally, values set by SetFile() or SetData() are not reset by a call to Stop(). However, + * if a file request callback has been set (via CriMvEasyPlayer::SetFileRequestCallback()), this + * setting will be reset. + * + * \sa CriMvEasyPlayer::Stop(), CriMvEasyPlayer::SetFileRequestCallback() + */ + /*JP + * \ingroup MODULE_OPTION + * \brief パラメータのリセット + * \param err エラー情報(省略可) + * + * 再生ハンドルに設定されたパラメータ類をリセットします。
+ * ただしサブオーディオ用インタフェースだけはリセットされませんので、アプリケーションで明示的に + * CriMvEasyPlayer::DetachSubAudioInterface() を呼び出してください。 + * + * 本関数はハンドル状態が MVEASY_STATUS_STOP または MVEASY_STATUS_PLAYEND の時に呼び出してください。 + * + * + *
設定関数 ResetAllParametersによる
リセット処理
Stopによる
リセット処理 + *
SetFile o (*1) + *
SetData o (*1) + *
Pause o o + *
SetMasterTimer o x + *
SetNumberOfFramePools o x + *
SetBufferingTime o x + *
SetReloadThresholdTime o x + *
SetMaxBitrate o x + *
SetAudioTrack o x + *
SetLoopFlag o x + *
SetStreamingParameters o x + *
AttachSubAudioInterface x x + *
SetSubAudioTrack o x + *
ReplaceCenterVoice o x + *
SetFileRequestCallback o x + *
SetSeekPosition o x + *
SetCuePointCallback o x + *
+ * (*1) 通常はリセットされません。ただしファイル要求コールバックが登録されていた場合はリセットされます。 + * + * \sa CriMvEasyPlayer::Stop() + */ + void ResetAllParameters(CriError &err=CriMv::ErrorContainer); + + /* 再生用ワークバッファおよび下位モジュールの解放(明示的な呼び出し用) */ + void ReleasePlaybackWork(CriError &err=CriMv::ErrorContainer); + +public: /* for DEBUG */ + /*//EN + * \ingroup MODULE_OPTION + * + * \brief Sets the maximum movie data read size + * + * \param max_chunk_size The maximum read size, in bytes + * \param err Optional error code + * + * This is a DEBUG function and should not normally need to be used by applications. + * + * Sets the maximum read size. CRI Movie will attempt to read this many bytes each time it + * needs to load more movie data from disk. + * + * If this function is called, it must be called before calling any of the playback functions + * (CriMvEasyPlayer::Start(), CriMvEasyPlayer::Prepare(), or CriMvEasyPlayer::DecodeHeader()). + * + * To revert to the default behavior, pass 0 as \a max_chunk_size. + * + * \remarks + * If this function is called, the new value for \a max_chunk_size will not be reflected in the + * CriMvStreapingParameters structure. A call to CriMvEasyPlayer::GetMovieInfo() will return the + * original value that was set in the movie header. + * + * \remarks + * If you call CriMvEasyPlayer::SetStreamingParameters(), this function can not be used. + * + * \sa CriMvEasyPlayer::GetMovieInfo(), CriMvEasyPlayer::SetMinBufferSize() + */ + /*//JP + * \ingroup MODULE_OPTION + * \brief 最大チャンクサイズの指定 + * \param max_chunk_size 最大チャンクサイズ[byte] + * \param err エラー情報(省略可) + * + * ムービデータの最大チャンクサイズを指定します。
+ * 現在のライブラリでは、本関数はアプリケーションから使用する必要はありません。
+ * + * 本関数で設定した最大チャンクサイズは、CriMvEasyPlayer::GetMovieInfo 関数で取得するムービ情報には反映されません。 + * CriMvEasyPlayer::GetMovieInfo 関数で取得できるのはムービデータの本来の情報です。
+ * + * 本関数の呼び出しは、 CriMvEasyPlayer::Prepare 関数または CriMvEasyPlayer::Start 関数の前までに実行してください。 + * + * 最大チャンクサイズに 0を指定した場合、最大チャンクサイズはムービデータの持つ値となります。
+ * また、アプリケーションが CriMvEasyPlayer::SetStreamingParameters 関数を呼び出した場合は本関数で + * 設定した値よりも、 CriMvEasyPlayer::SetStreamingParameters 関数の指定が優先されます。 + * + * \sa CriMvEasyPlayer::GetMovieInfo(), CriMvEasyPlayer::SetMinBufferSize() + */ + void SetMaxChunkSize(CriUint32 max_chunk_size, CriError &err=CriMv::ErrorContainer); + + /*//EN + * \ingroup MODULE_OPTION + * + * \brief Sets the minimum movie data buffer size + * + * \param min_buffer_size The minimum buffer size, in bytes + * \param err Optional error code + * + * This is a DEBUG function and should not normally need to be used by applications. + * + * Sets the minimum buffer size used for reading movie data from disk. + * + * If this function is called, it must be called before calling any of the playback functions + * (CriMvEasyPlayer::Start(), CriMvEasyPlayer::Prepare(), or CriMvEasyPlayer::DecodeHeader()). + * + * To revert to the default behavior, pass 0 as \a max_chunk_size. + * + * \remarks + * If this function is called, the new value for \a min_buffer_size will not be reflected in the + * CriMvStreapingParameters structure. A call to CriMvEasyPlayer::GetMovieInfo() will return the + * original value that was set in the movie header. + * + * \remarks + * If you call CriMvEasyPlayer::SetStreamingParameters(), this function can not be used. + * + * \sa CriMvEasyPlayer::GetMovieInfo(), CriMvEasyPlayer::SetMaxChunkSize() + */ + /*//JP + * \ingroup MODULE_OPTION + * \brief 最小バッファサイズの指定 + * \param min_buffer_size 最小バッファサイズ[byte] + * \param err エラー情報(省略可) + * + * ムービデータの最小バッファサイズを指定します。
+ * 現在のライブラリでは、本関数はアプリケーションから使用する必要はありません。
+ * + * 本関数で設定した最小バッファサイズは、CriMvEasyPlayer::GetMovieInfo 関数で取得するムービ情報には反映されません。 + * CriMvEasyPlayer::GetMovieInfo 関数で取得できるのはムービデータの本来の情報です。
+ * + * 本関数の呼び出しは、 CriMvEasyPlayer::Prepare 関数または CriMvEasyPlayer::Start 関数の前までに実行してください。 + * + * 最小バッファサイズに 0を指定した場合、最小バッファサイズはムービデータの持つ値となります。
+ * また、アプリケーションが CriMvEasyPlayer::SetStreamingParameters 関数を呼び出した場合は本関数で + * 設定した値よりも、 CriMvEasyPlayer::SetStreamingParameters 関数の指定が優先されます。 + * + * \sa CriMvEasyPlayer::GetMovieInfo(), CriMvEasyPlayer::SetMaxChunkSize() + */ + void SetMinBufferSize(CriUint32 min_buffer_size, CriError &err=CriMv::ErrorContainer); + + /*EN + * \ingroup MODULE_OPTION + * + * \brief Retrieves various movie playback statistics + * + * \param playinfo Playback statistics structure + * \param err Optional error code + * + * This is a DEBUG function and is not normally needed by applications. + * + * Retrieves a number of performance statistics dealing with movie playback, including how often + * a frame could not be retrieved and how close the plaback framerate is to the movie's expected + * playback. + * + * This information is updated on every call to CriMvEasyPlayer::IsNextFrameOnTime(). In order for + * the values to be accurate, an application should call IsNextFrameOnTime() once each time through + * its main loop. Calling IsNextFrameOnTime() too often or not often enough will result in + * misleading statistics. + * + * \sa CriMvEasyPlayer::IsNextFrameOnTime() + */ + /*JP + * \ingroup MODULE_OPTION + * \brief ムービ再生情報の取得 + * \param playinfo ムービ情報(返り値) + * \param err エラー情報(省略可) + * + * 本関数は通常、アプリケーションからは使用しません。デバッグ用の関数です。 + * + * 現在再生しているムービの再生情報 CriMvPlaybackInfo 構造体を取得できます。
+ * この情報からビデオフレームの取得間隔や、ビデオフレームのデコード遅延などを知ることができます。
+ * + * 再生情報はアプリが呼び出す CriMvEasyPlayer::IsNextFrameOnTime() 内で更新します。
+ * アプリケーションが CriMvEasyPlayer::IsNextFrameOnTime()を呼び出さない場合や、メインループで複数回 + * 呼び出す場合は情報が正しく更新されないので注意してください。
+ * + * \sa CriMvEasyPlayer::IsNextFrameOnTime() + */ + void GetPlaybackInfo(CriMvPlaybackInfo & playinfo, CriError & err = CriMv::ErrorContainer); + + /*EN + * \ingroup MODULE_OPTION + * + * \brief Gets the result of the last attempt to retrieve a video frame + * + * \param err Optional error code + * + * \return The result of the last frame retrieval + * + * Returns one of the following values: + * + * + * + * + * + * + * + *
Value Meaning
CRIMV_LASTFRAME_OK The frame was successfully retrieved.
CRIMV_LASTFRAME_TIME_EARLY It is too soon to display this frame. The frame time + * is greater than the current playback time.
CRIMV_LASTFRAME_DECODE_DELAY The frame has not been decoded yet, or CRI Movie is not + * done decoding it.
CRIMV_LASTFRAME_DISCARDED The frame was discarded, by calling + * CriMvEasyPlayer::DiscardNextFrame()
+ * + * \remarks + * The result is determined by calling CriMvEasyPlayer::IsNextFrameOnTime(), not the GetFrameOnTimeXXX() + * functions. + * + * \sa CriMvEasyPlayer::IsNextFrameOnTime(), CriMvEasyPlayer::DiscardNextFrame() + */ + /*JP + * \ingroup MODULE_OPTION + * \brief 前回のビデオフレーム取得の結果を取得する + * \param err エラー情報(省略可) + * \return フレーム取得結果の列挙値 + * + * 本関数は通常、アプリケーションからは使用しません。デバッグ用の関数です。 + * + * 前回のビデオフレーム取得の結果を返します。 + * ビデオフレームのデコードが間に合っているのかどうかをチェックすることが出来ます。 + * + * 注意:
+ * ビデオフレーム取得の結果とは、基本的にアプリケーションが呼び出す CriMvEasyPlayer::IsNextFrameOnTime() の結果を元に + * 更新します。GetFrameOnTime関数の結果ではありません。 + * + * \sa CriMvEasyPlayer::IsNextFrameOnTime() + */ + CriMvLastFrameResult GetLastFrameResult(CriError & err = CriMv::ErrorContainer); + + /* [Unofficial] */ + /* Set the number of decoded frames to keep internally during the MVEASY_STATUS_PREP status. */ + /* Adjust the number if you need to reduce latesy for the first frame */ + void SetNumberOfFramesForPrep(CriUint32 num_frames, CriError & err = CriMv::ErrorContainer); + + /* [Unofficial] + * \ingroup MODULE_OPTION + * \brief 再生終了/停止通知コールバック関数の登録 + * \param func 再生終了/停止通知コールバック関数 + * \param usrobj ユーザオブジェクト + * \param err エラー情報(省略可) + * + * 再生終了および再生停止を通知するコールバック関数を登録します。 + * このコールバック関数は、ヘッダ解析/再生準備/再生状態から再生停止/再生終了状態に + * 遷移した直後に一度だけ呼び出されます。 + * コールバック関数の呼び出しは CriMvEasyPlayer::Update() から行われます。 + * + * 登録したコールバック関数内では、ムービ再生をコントロールする関数(例えば CriMvEasyPlayer::Stop()) + * を呼び出してはいけません。 + * + * 注意: MVEASY_STATUS_PLAYEND状態からMVEASY_STATUS_STOP状態への遷移時にはコールバック関数は呼び出されません。 + */ + void SetStopCompleteCallback(void (*func)(CriMvEasyPlayer *mveasy, void *usrobj), + void *usrobj, CriError &err=CriMv::ErrorContainer); + + /* For FAST_LATENCY */ + /*************************************************************************************/ + /* コンフィグ指定のハンドル作成関数 */ + static CriMvEasyPlayer* CRIAPI Create(CriHeap heap, + CriMvHandleConfig *config, + CriMvFileReaderInterface *freader, + CriMvSystemTimerInterface *stimer, + CriMvSoundInterface *sound, + CriError &err=CriMv::ErrorContainer); + + /* For Sofdec2 */ + /*************************************************************************************/ + enum MetaFlag { + MVEASY_META_FLAG_CUE = 0x0001, + MVEASY_META_FLAG_SEEK = 0x0002, + MVEASY_META_FLAG_ALL = MVEASY_META_FLAG_CUE + MVEASY_META_FLAG_SEEK, + + /* Keep enum 4bytes */ + MVEASY_META_FLAG_MAKE_ENUM_SINT32 = 0x7FFFFFFF + }; + + enum ReferFrameResult { + MVEASY_REFER_FRAME_RESULT_OK = (1), + MVEASY_REFER_FRAME_RESULT_SHORT_INPUT = (2), + MVEASY_REFER_FRAME_RESULT_SHORT_CPUTIME = (3), + MVEASY_REFER_FRAME_RESULT_DEMUX_STUCK = (4), + + /* Keep enum 4bytes */ + MVEASY_REFER_FRAME_RESULT_MAKE_ENUM_SINT32 = 0x7FFFFFFF + }; + + /* ユーザからのワーク領域渡し版、ハンドル作成関数 */ + static CriMvEasyPlayer* CRIAPI Create(void *work, CriSint32 work_size, + CriMvHandleConfig *config, + CriMvFileReaderInterface *freader, + CriMvSystemTimerInterface *stimer, + CriMvSoundInterface *sound, + CriError &err=CriMv::ErrorContainer); + + /* 再生用ワーク領域サイズの計算 */ + CriSint32 CalcPlaybackWorkSize(const CriMvStreamingParameters *stmprm, CriError & err = CriMv::ErrorContainer); + + /* 再生用ワーク領域の設定関数 */ + void SetPlaybackWork(void *work, Sint32 work_size, CriError & err = CriMv::ErrorContainer); + + /* メタデータワーク用コールバック関数 */ + void SetMetaDataWorkAllocator(CriMvMetaDataWorkMallocFunc allocfunc, CriMvMetaDataWorkFreeFunc freefunc,void *usrobj, CriMvMetaFlag meta_flag); + + /* 引数で指定したフレーム情報の表示判定 */ + CriBool IsFrameOnTime(const CriMvFrameInfo *frameinfo, CriError &err=CriMv::ErrorContainer); + + /* フレームの参照 */ + ReferFrameResult ReferFrame(CriMvFrameInfo &frameinfo, CriError &err=CriMv::ErrorContainer); + + /* YUV個別バッファフォーマットでのバッファ取得 */ + CriBool LockFrameYUVBuffersWithAlpha(CriMvYuvBuffers &yuvbuffers, CriMvFrameInfo &frameinfo, CriMvAlphaFrameInfo &alpha_frameinfo, CriError &err=CriMv::ErrorContainer); + + /* LockFrameYUVBuffersWithAlphaでロックしたフレームの解放 */ + CriBool UnlockFrameBufferWithAlpha(CriMvFrameInfo *frameinfo, CriMvAlphaFrameInfo *alpha_frameinfo, CriError &err=CriMv::ErrorContainer); + + /* 32bitARGBバッファフォーマットへのコピー関数 */ + CriBool CopyFrameToBufferARGB32(CriUint8 *dstbuf, CriUint32 dst_pitch, CriUint32 dst_bufsize, + const CriMvYuvBuffers *srcbufs, const CriMvFrameInfo *src_vinf, const CriMvAlphaFrameInfo *src_ainf, CriError &err=CriMv::ErrorContainer); + + /* 32bitARGBバッファフォーマットへαのみのコピー関数 */ + CriBool CopyAlphaToBufferARGB32( + const CriMvFrameInfo *src_vinf, + CriUint8 *dst_buf, + CriUint32 dst_pitch, + CriUint32 dst_bufsize, + CriError &err=CriMv::ErrorContainer + ); + +#if defined(XPT_TGT_IPHONE) || defined(XPT_TGT_WINMO) || defined(XPT_TGT_ANDROID) || defined(XPT_TGT_CQSH2A) || defined(XPT_TGT_ACRODEA) || defined(XPT_TGT_NACL) || defined(XPT_TGT_SH7269) || defined(XPT_TGT_PC)|| defined(XPT_TGT_TRGP6K) + CriBool CopyFrameToBufferRGB565(CriUint8 *dstbuf, CriUint32 dst_pitch, CriUint32 dst_bufsize, + const CriMvYuvBuffers *srcbufs, const CriMvFrameInfo *src_vinf, const CriMvAlphaFrameInfo *src_ainf, CriError &err=CriMv::ErrorContainer); +#endif + + /* YUV個別バッファフォーマットのコピー関数 */ + CriBool CopyFrameToBuffersYUV(CriMvYuvBuffers *dstbufs, + const CriMvFrameInfo *src_vinf, const CriMvAlphaFrameInfo *src_ainf, CriError &err=CriMv::ErrorContainer); + + /* リードバッファサイズの強制指定 */ + void SetReadBufferSize(CriUint32 buffer_size, CriError &err=CriMv::ErrorContainer); + + CriUint32 GetMinBufferSize(CriError &err=CriMv::ErrorContainer); + /**************************************************************************************/ + void SetVideoFramerate(CriUint32 framerate_n, CriUint32 framerate_d); + + void SetCompareFrameTimeCallback( + CriBool (*func)(CriMvEasyPlayer *mveasy, CriMvFrameInfo *frameinfo, CriUint64 count, CriUint64 unit, void *usrobj), + void *usrobj, CriError &err=CriMv::ErrorContainer); + void SetSeekFrameAndOffset(CriSint32 seek_frame_id, CriUint64 seek_byte, CriError &err=CriMv::ErrorContainer); + + enum InputMode { + MVEASY_INPUT_UNDEFINED, + MVEASY_INPUT_STREAMING, /* メモリストリーミング */ + MVEASY_INPUT_MEMORY, /* メモリ直接参照(ユニSJ) */ + + /* Keep enum 4bytes */ + MVEASY_INPUT_MAKE_ENUM_SINT32 = 0x7FFFFFFF + }; + /* 実験中: この関数のために InputMode 定義を暫定でpublicへ移動 */ + void SetMemoryPlaybackType(InputMode memplay_type, CriError &err=CriMv::ErrorContainer); + + /* デコードスキップの自動実行モード */ + //void SetAutoSkipDecode(CriBool sw, CriFloat32 margin_msec, CriError &err=CriMv::ErrorContainer) + + /* ファイル要求の再コールバック要求 */ + void DeferFileRequest(CriError &err=CriMv::ErrorContainer); + + /* for specific use */ + void SetHeaderAndBodyData(const CriUint64Adr header_ptr, CriSint64 header_size, + const CriUint64Adr body_ptr, CriSint64 body_size); + CriSint32 CalcFramepoolWorkSize(const CriMvStreamingParameters *stmprm, CriError & err = CriMv::ErrorContainer); + void SetFramepoolWork(void *work, CriSint32 work_size, CriError & err = CriMv::ErrorContainer); + void SetFramepoolWorkAllocator(CriMvFramepoolWorkMallocFunc allocfunc, CriMvFramepoolWorkFreeFunc freefunc, void *usrobj); + void SetCapacityOfPictureSize(CriSint32 video_picsize, CriSint32 alpha_picsize, CriError &err); + void GetUsrCapacityOfPictureSize(CriSint32 *video_picsize, CriSint32 *alpha_picsize); + void SetMaxMovieSize(CriUint32 max_width, CriUint32 max_height, CriError &err); + void GetMaxMovieSize(CriUint32 *max_width, CriUint32 *max_height); + CriBool PlaybackResourceAllocated() const; + CriBool CanReusePlaybackResource(const CriMvStreamingParameters *stmprm) const; + CriBool GetReusePlaybackResourceFlag() const; + +private: + /* CRI internal use only */ + + void initializeHandleParameters(void); + void initializeCompareFrameParameters(void); + void resetHandleParameters(void); + CriBool startInputAndDecoding(void); + CriBool isEndReadFile(void); + void reinputDataForLooping(void); + void executeFileCloseServer(void); + void supplyDataFromStreamer(void); + void executeFileReadServer(void); + void executeFileOpenServer(void); + void executeCuePointServer(void); + //void executeAutoSkipDecode(void); + void executeWaitStatusServer(CriError &err = CriMv::ErrorContainer); + void surveilTerminationInput(void); + CriBool isAvailableCenterVoice(const CriMvStreamingParameters *stmprm); + CriBool isAvailableSubAudio(const CriMvStreamingParameters *stmprm); + CriBool attachCenterVoice(void); + void detachCenterVoice(void); + + CriBool attachSubAudioHandle(CriHeap heap); + void detachSubAudioHandle(void); + + void getAudioTime(CriUint64 &out_count, CriUint64 &out_unit, CriUint64 s_count, CriUint64 s_unit); + + CriBool allocAndCreateModules(void); + void startModules(void); + void requestStopModules(void); + CriBool closeFileIfOpening(void); + CriBool isCompleteStopModules(void); + void tryCleanupModules(CriMvPlyStatus mvstat); + CriBool tryFreeAndDestroySubmodules(void); + void freeAndDestroyModules(void); + + CriUint32 adjustNumTrackAudioOut(void); + + /* ストリーミング用のパラメータ取得 */ + /* GetMovieInfo()との違いはユーザ指定値がどこまで反映されるか。 + * 例えば、最大チャンクサイズはこの関数ではユーザ指定値をとるが、GetMovieInfoだとファイルの値。 + * この関数は、内部で下位モジュール作成およびメモリ確保する時に使う。 */ + CriBool GetStreamingParameters(CriMvStreamingParameters &stmprm, CriError &err=CriMv::ErrorContainer); + + void setNormalErrorStatus(const CriChar8 *errmsg); + + CriBool compareFrameTimeSimple(CriMvEasyPlayer *mveasy, CriMvFrameInfo *frameinfo, CriUint64 count, CriUint64 unit, void *usrobj); + static CriBool compareFrameTimeFluctuation(CriMvEasyPlayer *mveasy, CriMvFrameInfo *frameinfo, CriUint64 count, CriUint64 unit, void *usrobj); + + Bool isNextFrameOnTime(CriBool update_stats, CriError &err); + Bool checkFrameTime(CriMvFrameInfo *frameinfo); + void updateGetFrameInfo(CriBool time_ready, CriBool acquired_frame, CriBool discard_frame, CriUint64 frame_count, CriUint64 frame_unit); + + /* for DEBUG */ + void crimveasy_SetSeekInfo(void); + + void executeUpdate(CriError &err); + +private: + static CriUint32 crimveasy_SupplyPcmDataByFloat32(void *obj, CriUint32 nch, CriFloat32 *pcmbuf[], CriUint32 req_nsmpl); + static CriUint32 crimveasy_SupplyPcmDataBySint16(void *obj, CriUint32 nch, CriSint16 *pcmbuf[], CriUint32 req_nsmpl); + static CriUint32 crimveasy_CalcAvailableNumSmpls(CriMvEasyPlayer *mveasy); + static CriUint32 crimveasy_GetWave16(CriMvEasyPlayer *mveasy, CriUint32 nch, CriSint16 *pcmbuf[], CriUint32 req_nsmpl); + static CriUint32 crimveasy_GetWave32(CriMvEasyPlayer *mveasy, CriUint32 nch, CriFloat32 *pcmbuf[], CriUint32 req_nsmpl); + + static CriUint32 crimveasy_SupplySubAudioDataByFloat32(void *obj, CriUint32 nch, CriFloat32 *pcmbuf[], CriUint32 req_nsmpl); + static CriUint32 crimveasy_GetSubAudioWave32(CriMvEasyPlayer *mveasy, CriUint32 nch, CriFloat32 *pcmbuf[], CriUint32 req_nsmpl); + static CriUint32 crimveasy_SupplySubAudioDataBySint16(void *obj, CriUint32 nch, CriSint16 *pcmbuf[], CriUint32 req_nsmpl); + static CriUint32 crimveasy_GetSubAudioWave16(CriMvEasyPlayer *mveasy, CriUint32 nch, CriSint16 *pcmbuf[], CriUint32 req_nsmpl); + +public: + CriMvPly mvply; /* Temporally allowed to access for debug */ + +private: + CriHeap heap; + CriBool user_stmprm_flag; + CriMvStreamingParameters stmprm; + CriBool alloced_submodules_flag; + CriMvFrameInfo frameinfo; + CriMvAlphaFrameInfo alpha_frame; + CriMvFileReaderInterface *freader; + CriMvSoundInterface *sndout; + CriMvSystemTimerInterface *stimer; + TimerType timertype; + Status pre_ezstat; + CriBool req_decode_header_flag; + CriBool req_prepare_flag; + CriBool pause_flag; + CriUint32 npools; + CriSint32 track_play_audio; + CriUint32 num_track_audio_data; + CriUint32 num_track_audio_out; + CriBool loop_flag; + CriUint64 time_count; + CriUint64 time_unit; + CriSint64 total_read; + CriSint64 fsize_byte; + CriChunk read_crick; + CriBool exe_open; + CriBool exe_close; + CriBool exe_read; + + CriUint64 time_syslog_count; /* システムタイマの記録 */ + CriUint64 time_syslog_unit; + CriUint64 time_ofs_count; /* オーディオ終了時のシステムタイマ */ + CriUint64 time_ofs_unit; + CriUint64 time_prev_audio_count; /* オーディオ時刻変化チェック用 */ + CriUint64 time_prev_audio_unit; + + CriFloat32 user_buffering_sec; /* 0.0f means AUTO */ + CriUint32 user_max_bitrate; /* 0 means AUTO */ + CriUint32 user_max_chunk_size; /* 0 means AUTO */ + CriUint32 user_min_buffer_size; /* 0 means AUTO */ + CriSint32 user_read_buffer_size; /* CRIMV_READ_BUFFER_SIZE_AUTO means AUTO */ + CriSint32 user_video_capacity_of_picsize; /* 0 means AUTO */ + CriSint32 user_alpha_capacity_of_picsize; /* 0 means AUTO */ + CriUint32 user_max_width; + CriUint32 user_max_height; + + CriSint32 usr_subtitle_channel; + CriMvSubtitleInfo sbtinfo; + CriFloat32 sbt_start_msec; + CriFloat32 sbt_end_msec; + CriUint8 *sbtbuf; + + enum InputSrc { + MVEASY_INPUT_SRC_UNDEFINED, + MVEASY_INPUT_SRC_FILE, + MVEASY_INPUT_SRC_MEMORY, + /* Keep enum 4bytes */ + MVEASY_INPUT_SRC_MAKE_ENUM_SINT32 = 0x7FFFFFFF + }; + InputSrc input_src; + CriMvFileReaderInterface *ext_reader; + CriMvFileReaderInterface *mem_reader; + + enum InputSupplyStatus { + MVEASY_SUPPLY_STOP, + MVEASY_SUPPLY_REQ_OPEN, + MVEASY_SUPPLY_OPENING, + MVEASY_SUPPLY_READING, + MVEASY_SUPPLY_REQ_CLOSE, + MVEASY_SUPPLY_CLOSING, + + /* Keep enum 4bytes */ + MVEASY_SUPPLY_MAKE_ENUM_SINT32 = 0x7FFFFFFF + }; + + InputMode memplay_type; /* メモリ再生をストリームするかユニSJするか */ + InputMode input_mode; + InputSupplyStatus supply_stat; + CriBool change_file_mode; + CriChar8 file_name[CRIMV_MAX_FILE_NAME]; + CriUint64 file_offset; + CriSint64 file_range; + CriUint8 *dataptr; + CriUint32 datasize; + CriBool terminate_flag; + CriSint32 reinput_cnt; + + enum NextEntryState { + MVEASY_NEXT_ENTRY_NONE, + MVEASY_NEXT_ENTRY_READY, + MVEASY_NEXT_ENTRY_DEFER, + /* Keep enum 4bytes */ + MVEASY_NEXT_ENTRY_MAKE_ENUM_SINT32 = 0x7FFFFFFF + }; + NextEntryState next_entry_state; + + CriUint32 center_ch; + CriSint32 usr_voice_track; // by SetCenterVoice() + CriSint32 voice_attached_track; + + // Sub Audio + CriMvSoundInterface *if_subaudio; + CriSint32 usr_subaudio_track; + CriSint32 attached_subaudio_track; + + void (*cbfunc_file_request)(CriMvEasyPlayer *mveasy, void *usrobj); + void *usrobj_file_request; + + CriBool (*cbfunc_compare_ftime)(CriMvEasyPlayer *mveasy, CriMvFrameInfo *frameinfo, CriUint64 count, CriUint64 unit, void *usrobj); + void *usrobj_compare_ftime; + + /* Seek Playback */ + CriSint32 seek_frame_id; + CriUint64 seek_byte; + + /* CuePoint */ + void (*cbfunc_cuepoint)(CriMvEasyPlayer *mveasy, CriMvEventPoint *eventinfo, void *usrobj); + void *usrobj_cuepoint; + + /* Playback Statistics */ + CriBool start_getfrm; + CriUint64 last_getfrm_count; + CriFloat32 sum_diff_time; + CriMvPlaybackInfo playinfo; + CriMvLastFrameResult last_frm_result; + + /* Block flag for simultanious calls on multi-threads */ + CriSint32 execute_decode_block_flag; + CriSint32 update_block_flag; + + /* Stop Completion Notification */ + void (*cbfunc_stopcomplete)(CriMvEasyPlayer *mveasy, void *usrobj); + void *usrobj_stopcomplete; + + /* For Sofdec2 */ + void *playback_work; + CriSint32 playback_work_size; + void *mvply_work; + CriHeap heap_mveasy; + CriHeap heap_extra_sound; + CriBool reuse_modules_flag; + + /* For Debug */ + volatile CriUint8 end_sequence_info; + + /* Handle Protection */ + void *cshn; + void *cs_work; + + /* Skip Decoding */ + //CriBool skip_auto_flag; + //CriFloat32 margin_msec; + +public: + enum FrameCompareMode { + MVEASY_COMPARE_MODE_JUST, /* 正確に時刻比較する */ + MVEASY_COMPARE_MODE_DELAY_GET, /* タイマ時刻を前倒し=フレームはなるべく渡さない */ + MVEASY_COMPARE_MODE_FAST_GET, /* タイマ時刻を水増し=フレームはなるべく渡す */ + + /* Keep enum 4bytes */ + MVEASY_COMPARE_MODE_MAKE_ENUM_SINT32 = 0x7FFFFFFF + }; + FrameCompareMode compare_mode; + CriFloat32 accuracy_system_tmr_msec; /* システム時刻精度 milli sec */ + CriFloat32 accuracy_audio_tmr_msec; /* オーディオ時刻精度 milli sec */ + CriFloat32 fluctuation_system; /* システム(SyncFrame)の揺らぎ milli sec */ + CriFloat32 fluctuation_adjust; /* 揺らぎ補正 */ +// CriFloat32 fluctuation_system_msec; /* システム時刻ゆらぎ幅 milli sec */ +// CriFloat32 fluctuation_audio_msec; /* オーディオ時刻ゆらぎ幅 milli sec */ +// CriFloat32 fluctuation_adjust; /* ゆらぎ補正倍率 */ +// CriSint32 fluctuation_system_usec; /* システム時刻ゆらぎ幅 micro sec */ +// CriSint32 fluctuation_audio_usec; /* オーディオ時刻ゆらぎ幅 micro sec */ +// CriFloat32 fluctuation_adjust_multi; /* ゆらぎ補正倍率 */ +// CriSint32 fluctuation_adjust_add; /* ゆらぎ補正オフセット */ + +private: + CriBool req_stop_modules; + CriBool error_flag; + CriBool req_start_modules; + +protected: + CriMvEasyPlayer(CriHeap heap, + CriMvFileReaderInterface *freader, + CriMvSystemTimerInterface *stimer, + CriMvSoundInterface *sound, + CriError &err=CriMv::ErrorContainer); + virtual ~CriMvEasyPlayer(); + +private: + CriMvEasyPlayer(void); //disabled +}; + + + + +#endif /* CRI_MOVIE_H_INCLUDED */ diff --git a/3rdParty/cri/PS4/include/cri_movie_core.h b/3rdParty/cri/PS4/include/cri_movie_core.h new file mode 100644 index 00000000..06f7f797 --- /dev/null +++ b/3rdParty/cri/PS4/include/cri_movie_core.h @@ -0,0 +1,2554 @@ +/**************************************************************************** + * + * CRI Middleware SDK + * + * Copyright (c) 2005-2013 CRI Middleware Co., Ltd. + * + * Library : CRI Movie + * Module : Library User's Header + * File : cri_movie_core.h + * Date : 2013-11-21 + * Version : (see CRIMVPLY_VER) + * + ****************************************************************************/ +/*! + * \file cri_movie_core.h + */ +#ifndef CRI_MOVIE_CORE_H_INCLUDED /* Re-definition prevention */ +#define CRI_MOVIE_CORE_H_INCLUDED + +/* Version No. */ +#define CRIMVPLY_VER "3.50" +#define CRIMVPLY_NAME "criMvPly" + +/*************************************************************************** + * Include file + ***************************************************************************/ +#include +#include +#include + +/*************************************************************************** + * MACRO CONSTANT + ***************************************************************************/ + +/*EN + * \brief Audio OFF setting of Audio Track + * \ingroup MDL_MV_OPTION + * \sa CriMvEasyPlayer::SetAudioTrack() + */ +/*JP + * \brief オーディオ再生OFFの指定値 + * \ingroup MDL_MV_OPTION + * \sa CriMvEasyPlayer::SetAudioTrack() + */ +#define CRIMV_AUDIO_TRACK_OFF (-1) + +/*EN + * \brief Default setting of Audio Track + * \ingroup MDL_MV_OPTION + * \sa CriMvEasyPlayer::SetAudioTrack() + */ +/*JP + * \brief オーディオチャネルのデフォルト値 + * \ingroup MDL_MV_OPTION + * \sa CriMvEasyPlayer::SetAudioTrack() + */ +#define CRIMV_AUDIO_TRACK_AUTO (100) + +/*EN + * \brief Maximum number of PCM tracks in one audio stream + * \ingroup MDL_MV_OPTION + */ +/*JP + * \brief オーディオデータ内の最大PCMトラック数 + * \ingroup MDL_MV_OPTION + */ +#define CRIMV_PCM_BUFFER_MAX (8) + +/*EN + * \brief Subtitle OFF setting + * \ingroup MDL_MV_OPTION + * \sa CriMvEasyPlayer::SetSubtitleChannel() + */ +/*JP + * \brief 字幕再生OFFの指定値 + * \ingroup MDL_MV_OPTION + * \sa CriMvEasyPlayer::SetSubtitleChannel() + */ +#define CRIMV_SUBTITLE_CHANNEL_OFF (-1) + +/*EN + * \brief Maximum number of video tracks in a movie file + * \ingroup MDL_MV_OPTION + */ +/*JP + * \brief ムービファイル内の最大ビデオストリーム数 + * \ingroup MDL_MV_OPTION + */ +#define CRIMV_MAX_VIDEO_NUM (1) + +/*EN + * \brief Maximum number of audio tracks in a movie file + * \ingroup MDL_MV_OPTION + */ +/*JP + * \brief ムービファイル内の最大オーディオストリーム数 + * \ingroup MDL_MV_OPTION + */ +#define CRIMV_MAX_AUDIO_NUM (32) + +/*EN + * \brief Maximum number of alpha tracks in a movie file + * \ingroup MDL_MV_OPTION + */ +/*JP + * \brief ムービファイル内の最大アルファストリーム数 + * \ingroup MDL_MV_OPTION + */ +#define CRIMV_MAX_ALPHA_NUM (1) + +#if defined(XPT_TGT_PC) +/*EN + * \brief Number of extra threads for multicore decoding + * \ingroup MDL_MV_OPTION + * The number of additional decoding threads that CRI Movie library internally creates. + * The threads are intended to run on multiple processors in parallel. + * \sa CriMvEasyPlayer::SetUsableProcessors_PC() + */ +/*JP + * \brief マルチコアデコード用の追加のデコードスレッド数 + * \ingroup MDL_MV_OPTION + * CRI Movieライブラリが内部で作成する追加のデコードの数です。これらのスレッドは、マルチコアPC上で + * デコード処理を並列分散させるために作られます。 + * \sa CriMvEasyPlayer::SetUsableProcessors_PC() + */ +#define CRIMV_NUM_EXT_DECTHREAD_PC (3) + +/*EN + * \brief Default affnity mask of a thread + * \ingroup MDL_MV_OPTION + * \sa CriMvEasyPlayer::SetUsableProcessors_PC() + */ +/*JP + * \brief スレッドアフィニティマスクのデフォルト設定値 + * \ingroup MDL_MV_OPTION + * \sa CriMvEasyPlayer::SetUsableProcessors_PC() + */ +#define CRIMV_DEFAULT_AFFNITY_MASK_PC (0xFFFFFFFF) + + +/*EN + * \brief Default priority of a thread + * \ingroup MDL_MV_OPTION + * \sa CriMvEasyPlayer::SetUsableProcessors_PC() + */ +/*JP + * \brief スレッドのデフォルト優先度 + * \ingroup MDL_MV_OPTION + * \sa CriMvEasyPlayer::SetUsableProcessors_PC() + */ +#define CRIMV_DEFAULT_THREAD_PRIORITY_PC (0x8000000) +#endif + +/*EN + * \brief Default value of the read buffer size + * \ingroup MDL_MV_OPTION + * \sa CriMvEasyPlayer::SetReadBufferSize() + */ +/*JP + * \brief リードバッファサイズをデフォルト値 + * \ingroup MDL_MV_OPTION + * \sa CriMvEasyPlayer::SetReadBufferSize() + */ +#define CRIMV_READ_BUFFER_SIZE_AUTO (-1) + + +/*************************************************************************** + * Library Spec Defenition + ***************************************************************************/ + +/* */ + +/* 2007-09-06:URUSHI オーディオ処理のサブモジュール化 * + * MvPlyのオーディオ処理部分をCriMvPlyAmngという新たなクラスに切り出す。* + * CriMvPlyAmngはデマルチプレクサから全トラックデータを受け取って、 * + * トラックごとに割り振られたAdecに処理を渡します。 * + * 目的は以下の二つ * + * 1) オーディオトラックの動的切替 * + * 2) ループ再生での異なるAV尺の同期 */ + +#define NUM_MAX_ADEC (2) /* Adecの最大数 */ +/* ADECのインデックス定義 */ +/* このindexを使ってCriMvPlyAmngからAdecをコントロールしてください。 */ +#define MAIN_ADEC_IDX (0) // メイントラック用 +#define SUB_ADEC_IDX (1) // ボイストラック用 + +/* オーディオの動的切替機能をサポートするか */ +//#define ENABLE_DYNAMIC_AUDIO_SWITCH + +#if defined(ENABLE_DYNAMIC_AUDIO_SWITCH) + #define CRIMVPLYAMNG_TRACK_OFF (512) // 切り替え先トラック番号のデフォルト値(切替OFF) + + /* トラックの動的切替のための状態定義 */ + typedef enum _crimvplyamng_track_state { + CRIMVPLYAMNG_TRACK_STATE_FIXED = (1), // デフォルト + CRIMVPLYAMNG_TRACK_STATE_PREP_SWITCHING, // ユーザが切替を命令し、切替の準備段階(時刻判定のための基準時間をセット) + CRIMVPLYAMNG_TRACK_STATE_SWITCHING // 切替元と先の時刻判定を行なって切替を行なう状態 + } CriMvPlyAmngTrackState; +#endif + +/* 連結再生時、2個目以降のヘッダを取得できるようにするため */ +#define CRIMVPLY_HEAD_CONTAINER_NUM (2) + +/* 再読み込み閾値のデフォルト値 */ +#define CRIMV_DEFAULT_RELOAD_THRESHOLD (0.8f) // 0.8[sec] + +/* 再生準備中の貯金フレーム数デフォルト値 */ +#define CRIMV_DEFAULT_NUM_FRAMES_FOR_PREP (-1) /* デフォルト:不使用 (フレームプール数を採用) */ + +/* 内部ワーク領域の確保にCRI Heapを使用しない */ +#define CRIMV_REMOVE_CRIHEAP + +/* 機種固有フレーム情報数 */ +#define CRIMV_FRAME_DETAILS_NUM (2) + +/* CriVavfios で指定する外部ファイルのパスの上限 */ +#if defined(XPT_TGT_IOS) + #define CRIMVPLY_VAVFIOS_MAX_FILEPATH (256) +#endif + +/*************************************************************************** + * Process MACRO + ***************************************************************************/ +#define criMv_SetDefaultHandleConfig(p_config) \ +{\ + (p_config)->readbuffer_size = 0;\ +} + +/*************************************************************************** + * Enum declaration + ***************************************************************************/ +/*EN + * \brief Speaker index of CRI Movie PCM output + * \ingroup MDL_MV_OPTION + */ +/*JP + * \brief CRI Movie のPCM出力のスピーカー配置 + * \ingroup MDL_MV_OPTION + */ +typedef enum { + CRIMV_PCM_BUFFER_L = 0, /*EN< The LEFT channel of CRI Movie output */ + /*JP< CRI Movie オーディオ出力の LEFT チャンネル */ + CRIMV_PCM_BUFFER_R = 1, /*EN< The RIGHT channel of CRI Movie output */ + /*JP< CRI Movie オーディオ出力の RIGHT チャンネル */ + CRIMV_PCM_BUFFER_LS = 2, /*EN< The Surround LEFT channel of CRI Movie output */ + /*JP< CRI Movie オーディオ出力の Surround LEFT チャンネル */ + CRIMV_PCM_BUFFER_RS = 3, /*EN< The Surround RIGHT channel of CRI Movie output */ + /*JP< CRI Movie オーディオ出力の Surround RIGHT チャンネル */ + CRIMV_PCM_BUFFER_C = 4, /*EN< The CENTER channel of CRI Movie output */ + /*JP< CRI Movie オーディオ出力の CENTER チャンネル */ + CRIMV_PCM_BUFFER_LFE = 5, /*EN< The LFE channel of CRI Movie output */ + /*JP< CRI Movie オーディオ出力の LFE チャンネル */ + CRIMV_PCM_BUFFER_EXT1 = 6, /*EN< The EXT1(Rear Left) channel of CRI Movie output */ + /*JP< CRI Movie オーディオ出力の EXT1(Rear Left) チャンネル */ + CRIMV_PCM_BUFFER_EXT2 = 7, /*EN< The EXT2(Rear Right) channel of CRI Movie output */ + /*JP< CRI Movie オーディオ出力の EXT2(Rear Right) チャンネル */ + + /* Keep enum 4bytes */ + CRIMV_PCM_BUFFER_MAKE_ENUM_SINT32 = 0x7FFFFFFF +} CriMvPcmBufferIndex; + + +/*EN + * \brief Composite mode of alpha movie + * \ingroup MDL_MV_OPTION + */ +/*JP + * \brief アルファムービの合成モード + * \ingroup MDL_MV_OPTION + */ +typedef enum { + CRIMV_COMPO_OPAQ = 0, /*EN< Opacity, no alpha value */ + /*JP< 不透明、アルファ情報なし */ + CRIMV_COMPO_ALPHFULL = 1, /*EN< Full alpha blending (8bits-alpha data) */ + /*JP< フルAlpha合成(アルファ用データが8ビット) */ + CRIMV_COMPO_ALPH3STEP = 2, /*EN< 3 Step Alpha */ + /*JP< 3値アルファ */ + CRIMV_COMPO_ALPH32BIT = 3, /*EN< Full alpha blending (32bits color + alpha data) */ + /*JP< フルAlpha、(カラーとアルファデータで32ビット) */ + CRIMV_COMPO_ALPH1BIT = 4, /*EN< Alpha blending (24bits color + 1->8bits alpha) */ + /*JP< フルAlpha、(カラーとアルファデータで32bit、値は2値) */ + CRIMV_COMPO_ALPH2BIT = 5, /*EN< Alpha blending (24bits color + 2->8bits alpha) */ + /*JP< フルAlpha、(カラーとアルファデータで32bit、値は4値) */ + CRIMV_COMPO_ALPH3BIT = 6, /*EN< Alpha blending (24bits color + 3->8bits alpha) */ + /*JP< フルAlpha、(カラーとアルファデータで32bit、値は8値) */ + CRIMV_COMPO_ALPH4BIT = 7, /*EN< Alpha blending (24bits color + 4->8bits alpha) */ + /*JP< フルAlpha、(カラーとアルファデータで32bit、値は16値)*/ + + /* Keep enum 4bytes */ + CRIMV_COMPO_MAKE_ENUM_SINT32 = 0x7FFFFFFF +} CriMvAlphaType; + + +/*EN + * \brief Result of the last video frame retrieval + * \ingroup MDL_MV_OPTION + */ +/*JP + * \brief 前回のビデオフレーム取得の結果 + * \ingroup MDL_MV_OPTION + */ +typedef enum { + CRIMV_LASTFRAME_OK = 0, /*EN< Succeeded */ + /*JP< 取得成功 */ + CRIMV_LASTFRAME_TIME_EARLY = 1, /*EN< Failed. The frame is not yet the time to draw */ + /*JP< 取得失敗。フレーム表示時刻が再生時間に達していなかった */ + CRIMV_LASTFRAME_DECODE_DELAY = 2, /*EN< Failed. The frame to draw is not decoded yet */ + /*JP< 取得失敗。ビデオフレームのデコードが間に合わなかった */ + CRIMV_LASTFRAME_DISCARDED = 3, /*EN< Failed. The video frame is discarded by app */ + /*JP< 取得失敗。アプリによって破棄された */ + //CRIMV_LASTFRAME_NO_INPUT_DATA = 4, //Not supported yet + //CRIMV_LASTFRAME_SKIPPED = 5, //Not supported yet + //CRIMV_LASTFRAME_DEMUX_STUCKED = 6, //Not supported yet + + /* Keep enum 4bytes */ + CRIMV_LASTFRAME_MAKE_ENUM_SINT32 = 0x7FFFFFFF +} CriMvLastFrameResult; + +#if defined(XPT_TGT_PS3PPU) +/*EN + * \brief Graphic Environment type for PS3 + * \ingroup MDL_MV_OPTION + */ +/*JP + * \brief PS3のグラフィック環境 + * \ingroup MDL_MV_OPTION + */ +typedef enum { + CRIMV_GRAPHIC_ENV_GCM = 0, /*EN< GCM. (or same ARGB 32bit texture format of GCM) */ + /*JP< GCM環境 (またはテクスチャフォーマットがGCMと同じ環境) */ + CRIMV_GRAPHIC_ENV_PSGL = 1, /*EN< PSGL. (or same ARGB 32bit texture format of PSGL) */ + /*JP< PSGL環境 (またはテクスチャフォーマットがPSGLと同じ環境) */ + + /* Keep enum 4bytes */ + CRIMV_GRAPHIC_ENV_MAKE_ENUM_SINT32 = 0x7FFFFFFF +} CriMvGraphicEnv; +#endif + + +/* CRI Movie Interanl handle status + * + * The possible legal states of a CriMvPly handle. Over the course of your application + * the CriMvPly handle will walk through the following states in roughly the following + * order. In states that are waiting states, you can request the + * CriMvPly handle to advance to the next state by calling the criMvPly_IncrementState() + * function. You can check the status of a valid CriMvPly handle at any time + * by calling criMvPly_GetStatus(). + * + * It is not possible to jump from a state to an arbitrary other state. Normal play + * proceeds from the CRIMVPLY_STATUS_STOP state through the CRIMV_PLY_STATUS_PLAYEND + * state in that order. Premature termination can be requested with the criMvPly_Stop() + * function. + * + * \sa criMvPly_IncrementState(), criMvPly_GetStatus(), criMvPly_Stop() + */ +typedef enum { + CRIMVPLY_STATUS_STOP = 0, /* Standstill. No processing is occurring. + * CriMvPly handles are created into this state. + */ + /* 停止中 */ + CRIMVPLY_STATUS_DECHDR = 1, /* The CriMvPly structure is now parsing the header + * of the file, including information on height and width + * of the video stream. + */ + /* ヘッダ解析中 */ + CRIMVPLY_STATUS_WAIT_PREP = 2, /* The header has been decoded and criMvPly_GetStreamingParameters() + * will now provide valid values. Typically you will call + * criMvPly_AllocateWorkBuffer() with this information at this point. + */ + /* PREP状態へのIncrementState待ち
+ AllocateWorkBufferしてから次へいくこと */ + CRIMVPLY_STATUS_PREP = 3, /* Transition to this state to acknowledge to the + * CriMvPly handle that you have allocated your work buffers. */ + /* 再生準備中 */ + CRIMVPLY_STATUS_WAIT_PLAYING = 4, /* The audio and video decoders are now ready to begin playback.*/ + /* PLAYING状態へのIncrementState待ち
+ この状態で既にビデオとオーディオのデコード結果は取得できる。*/ + CRIMVPLY_STATUS_PLAYING = 5, /* The decoders are currently decoding and playing output. */ + /* 再生中 */ + CRIMVPLY_STATUS_WAIT_PLAYEND = 6, /* The library is waiting for you to acknowledge the end of the movie. You + * have informed the CriMvPly structure that an end-of-file condition exists, + * but final frames of video and audio may still be pending in your application. */ + /* PLAYEND状態へのIncrementState待ち */ + CRIMVPLY_STATUS_PLAYEND = 7, /* You have acknowledged the end of the movie. Teardown can occur at this point. */ + /* 再生終了 */ + CRIMVPLY_STATUS_STOP_PROCESSING = 8, /* A request to stop has been received by the CriMvPly structure, + * that is, you have called criMvPly_Stop(), and a stop is now pending. */ + /* 停止処理中 */ + CRIMVPLY_STATUS_WAIT_STOP = 9, /* The CriMvPly handle has acknowledged the stop request and + * you may now call criMvPly_IncrementState() to transition to + * the CRIMVPLY_STATUS_STOP state. */ + /* STOP状態へのIncrementState待ち */ + CRIMVPLY_STATUS_ERROR = 10, /* An error has occurred. */ + /* エラー */ + + /* Keep enum 4bytes */ + CRIMVPLY_STATUS_MAKE_ENUM_SINT32 = 0x7FFFFFFF +} CriMvPlyStatus; + + +/* Sofdec2 */ +typedef enum { + CRIMVPLY_META_FLAG_OFF = 0x0000, + CRIMVPLY_META_FLAG_CUE = 0x0001, + CRIMVPLY_META_FLAG_SEEK = 0x0002, + CRIMVPLY_META_FLAG_ALL = CRIMVPLY_META_FLAG_CUE + CRIMVPLY_META_FLAG_SEEK, + + /* Keep enum 4bytes */ + CRIMVPLY_META_FLAG_MAKE_ENUM_SINT32 = 0x7FFFFFFF +} CriMvMetaFlag; + +/* Color Conversion*/ +typedef enum{ + CRIMV_COLORSPACE_CONVERSION_TYPE_ITU_R_BT601_LIMITED = 0, + CRIMV_COLORSPACE_CONVERSION_TYPE_ITU_R_BT601_FULLRANGE = 1, + + /* Keep enum 4bytes */ + CRIMV_COLORSPACE_CONVERSION_TYPE_ENUM_SINT32 = 0x7FFFFFFF +}CriMvColorSpaceConversionType; + +typedef void *(*CriMvMetaDataWorkMallocFunc)(void *obj, CriUint32 size); +typedef void (*CriMvMetaDataWorkFreeFunc)(void *obj, void *mem); + +/* OUTER_FRAMEPOOL_WORK */ +#define CriMvFramepoolWorkMallocFunc CriMvMetaDataWorkMallocFunc +#define CriMvFramepoolWorkFreeFunc CriMvMetaDataWorkFreeFunc + +/*************************************************************************** + * Data type declaration + ***************************************************************************/ + +/*EN + * \brief Audio parameters + * \ingroup MDL_MV_INFO + * + * \sa CriMvStreamingParameters, CriMvWaveInfo + */ +/*JP + * \brief オーディオパラメータ + * \ingroup MDL_MV_INFO + * + * オーディオストリームのパラメータ + * \sa CriMvStreamingParameters, CriMvWaveInfo + */ +typedef struct { + CriUint32 sampling_rate; /*EN< Sampling rate */ + /*JP< サンプリング周波数 */ + CriUint32 num_channel; /*EN< Number of channels. Monaural = 1, Stereo = 2 */ + /*JP< オーディオチャネル数 */ + CriUint32 total_samples; /*EN< Total number of samples */ + /*JP< 総サンプル数 */ + CriUint32 output_buffer_samples; /*EN< Output wave buffer size */ + /*JP< サウンド出力バッファのサンプル数 */ + CriUint32 codec_type; /*EN< Codec type */ + /*JP< コーデック種別 */ + +} CriMvAudioParameters; + +/*EN + * \brief Video Parameters + * \ingroup MDL_MV_INFO + * \sa CriMvStreamingParameters + */ +/*JP + * \brief ビデオパラメータ + * \ingroup MDL_MV_INFO + * ビデオストリームのパラメータ + * \sa CriMvStreamingParameters + */ +typedef struct { + CriUint32 max_width; /*EN< Maximum video width for stream. (multiple of 8) */ + /*JP< ムービ最大幅(8の倍数) */ + CriUint32 max_height; /*EN< Maximum video height for stream. (multiple of 8)*/ + /*JP< ムービ最大高さ(8の倍数) */ + CriUint32 disp_width; /*EN< Width of the image to draw. */ + /*JP< 表示したい映像の横ピクセル数(左端から) */ + CriUint32 disp_height; /*EN< Height of the image to draw. */ + /*JP< 表示したい映像の縦ピクセル数(上端から) */ + CriUint32 num_frame_pool; /*EN< Number of frame pools required for stream */ + /*JP< フレームプール数 */ + CriUint32 framerate; /*EN< Frame rate per second [x1000]. */ + /*JP< フレームレート[x1000] */ + CriUint32 framerate_n; /*EN< Frame rate (in rational as numerator). framerate_n/framerate_d = framerate */ /* UTODO: 変数名 */ + /*JP< フレームレートの分子(有理数形式)。framerate_n/framerate_d = framerate */ + CriUint32 framerate_d; /*EN< Frame rate (in rational as denominator). */ + /*JP< フレームレートの分母(有理数形式)。 */ + CriUint32 total_frames; /*EN< Total number of video frames */ + /*JP< 総フレーム数 */ + + CriUint32 material_width; /*EN< Width of the video source resolustion before encoding. */ + /*JP< エンコード前のビデオ素材の横ピクセル数 */ + CriUint32 material_height; /*EN< Height of the video source resolustion before encoding. */ + /*JP< エンコード前のビデオ素材の縦ピクセル数 */ + CriUint32 screen_width; /*EN< Screen width set by encoding and cropping. + * This parameter is only available when you encoded the movie with "Widescreen TV Support" option. + * Normally this value is 0. */ + /*JP< エンコード時に指定したスクリーン幅。 + * この値はエンコード時に「ワイドテレビ支援機能」を使用した場合のみ有効になります。 + * 通常は0です。 */ + + CriUint32 codec_type; /*EN< Video Codec Type. If you encoded the movie for PS2, this value is 2. + * Normally this value is 1 or 0(no info). + * If the codec_type is 1, the CRI Movie for ONLY PS2 can play the movie file. */ + /*JP< ビデオコーデック種別。PS2用にエンコードした場合 2になります。 + * 通常は 1または 0(情報無し)です。 + * コーデック種別が2のムービは、PS2版ライブラリで「のみ」再生可能です。 */ + CriUint32 codec_dc_option; /*EN< Video Codec DC Option. If you encoded the movie for PS2, this value is 10. + * Normally this value is 11 or 0(no info). + * If the codec_type is 11, the CRI Movie for PS2 can NOT play the movie file. */ + /*JP< ビデオコーデックのDCオプション種別。PS2用にエンコードした場合10になります。 + * 通常は11または 0(情報無し)です。 + * コーデックDCオプションが11のムービは、PS2版ライブラリ「では」再生できません。 */ + CriUint32 color_conversion_type; /*EN< Color space converion type. Fullrange or Limited.*/ + /*JP< 色変換タイプ。 */ + CriSint32 capacity_of_picsize; /*EN< Capacity size of video pictures. */ + /*JP< ピクチャサイズ上限値 */ + CriUint32 average_bitrate; /*EN< Average bitrate. */ + /*JP< 平均ビットレート */ +} CriMvVideoParameters; + +/*EN + * \brief Alpha Parameters + * \ingroup MDL_MV_INFO + * \sa CriMvStreamingParameters + */ +/*JP + * \brief アルファパラメータ + * \ingroup MDL_MV_INFO + * アルファストリームのパラメータ + * \sa CriMvStreamingParameters + */ +typedef struct { + CriUint32 max_width; /*EN< Maximum alpha width for stream */ + /*JP< アルファフレームの最大幅 */ + CriUint32 max_height; /*EN< Maximum alpha height for stream */ + /*JP< アルファフレームの最大高さ */ + CriUint32 disp_width; /*EN< valid alpha width */ + /*JP< アルファフレームの実有効幅 */ + CriUint32 disp_height; /*EN< valid alpha height */ + /*JP< アルファフレームの実有効高さ */ + CriUint32 framerate; /*EN< Frame rate per second [x1000]. */ + /*JP< アルファのフレームレート[x1000] */ + CriUint32 framerate_n; /*EN< Frame rate (in rational as numerator). framerate_n/framerate_d = framerate */ /* UTODO: 変数名 */ + /*JP< フレームレートの分子(有理数形式)。framerate_n/framerate_d = framerate */ + CriUint32 framerate_d; /*EN< Frame rate (in rational as denominator). */ + /*JP< フレームレートの分母(有理数形式)。 */ + CriUint32 total_frames; /*EN< Total number of alpha frames */ + /*JP< 総フレーム数 */ + CriMvAlphaType alpha_type; /*EN< Alpha Composite Type. */ + /*JP< アルファ合成種別。 */ + CriUint32 codec_type; /*EN< Internal use only. Do not access this */ + /*JP< ライブラリ内部使用変数 */ + CriUint32 color_conversion_type; /*EN< Color space converion type. Fullrange or Limited.*/ + /*JP< 色変換タイプ。 */ + CriSint32 capacity_of_picsize; /*EN< Capacity size of video pictures. */ + /*JP< ピクチャサイズ上限値 */ + CriUint32 average_bitrate; /*EN< Average bitrate. */ + /*JP< 平均ビットレート */ +} CriMvAlphaParameters; + + +/*EN + * \brief Streaming Parameters + * \ingroup MDL_MV_INFO + * This structure includes streaming parameters and playing parameters. + * \sa CriMvEasyPlayer::GetMovieInfo() + */ +/*JP + * \brief ストリーミング再生パラメータ + * \ingroup MDL_MV_INFO + * ストリーミング再生パラメータ。
+ * ストリーム自体の情報と、再生のために必要なパラメータの両方を含んでいる。 + * \sa CriMvEasyPlayer::GetMovieInfo() + */ +typedef struct { + /* Stream */ + CriUint32 is_playable; /*EN< Flag of the movie file is playable or not. 1 is playable. 0 is not playable.*/ + /*JP< 再生可能フラグ(1: 再生可能、0: 再生不可) */ + CriFloat32 buffering_time; /*EN< Amount of time to buffer in the stream, in seconds */ + /*JP< 読み込みデータのバッファリング時間。単位[sec]。 */ + CriUint32 max_bitrate; /*EN< Maximum bits per second for stream. This value includes video and audio both. */ + /*JP< 最大ビットレート(絵と音の合計) */ + CriUint32 max_chunk_size; /*EN< Maximum chunk size of incoming stream (USF) file */ + /*JP< 最大USFチャンクサイズ */ + CriUint32 min_buffer_size; /*EN< Minimum buffer size for reading */ + /*JP< 最低限必要な読み込みバッファサイズ。
オーディオとビデオの合計 */ + CriSint32 read_buffer_size; /*EN< Input buffer size for reading data */ + /*JP< リードバッファサイズ */ + /* Video */ + CriUint32 num_video; /*EN< Number of simultaneous video streams */ + /*JP< ビデオデコーダの数。現在は1固定。*/ + CriMvVideoParameters video_prm[CRIMV_MAX_VIDEO_NUM]; /*EN< Video parameters see CriMvVideoParameters struct for details */ + /*JP< ビデオパラメータ */ + /* Audio */ + CriUint32 num_audio; /*EN< Number of simultaneous audio streams */ + /*JP< オーディオデコーダの数。現在は1固定。*/ + CriSint32 track_play_audio; /*EN< Track of audio playback. */ + /*JP< 再生するオーディオチャネル番号。-1指定で再生無し。 */ + CriMvAudioParameters audio_prm[CRIMV_MAX_AUDIO_NUM]; /*EN< Audio parameters see CriMvAudioParameters struct for details */ + /*JP< オーディオパラメータ */ + /* Subtitle */ + CriUint32 num_subtitle; /*EN< Number of subtitles */ + /*JP< 字幕チャネル数 */ + CriSint32 channel_play_subtitle; /*EN< Channel for playing subtitles */ + /*JP< 再生する字幕チャネル番号 */ + CriUint32 max_subtitle_size; /*EN< Maximum size of subtitle data */ + /*JP< 字幕データの最大サイズ*/ + + /* Composite mode */ + CriUint32 num_alpha; /*EN< Number of alpha channels (current spec allows only one) */ + /*JP< アルファデコーダの数。現在は1固定。 */ + CriMvAlphaParameters alpha_prm[CRIMV_MAX_ALPHA_NUM]; /*EN< Alpha parameters see CriMvAlphaParameters struct for details */ + /*JP< アルファパラメータ */ + + CriBool seekinfo_flag; /*EN< Flag of the movie file inclues seek info */ + /*JP< シーク情報フラグ */ + CriUint32 format_ver; /*EN< Format version */ + /*JP< フォーマットバージョン */ +} CriMvStreamingParameters; + + +/*EN + * \brief Input Buffer Information + * \ingroup MDL_MV_INFO + * \sa CriMvEasyPlayer::GetInputBufferInfo(), + * CriMvEasyPlayer::SetReloadThresholdTime(), CriMvEasyPlayer::SetBufferingTime() + */ +/*JP + * \brief 入力バッファ情報 + * \ingroup MDL_MV_INFO + * \sa CriMvEasyPlayer::GetInputBufferInfo(), + * CriMvEasyPlayer::SetReloadThresholdTime(), CriMvEasyPlayer::SetBufferingTime() + */ +typedef struct { + CriUint32 buffer_size; /*EN< Input buffer size [byte] */ + /*JP< 入力バッファサイズ[byte] */ + CriUint32 data_size; /*EN< Data size in input buffer[byte] */ + /*JP< 入力バッファにあるデータサイズ[byte] */ + CriUint32 reload_threshold; /*EN< Re-load threshold. When data size is less than re-load threshold, next read is requested. */ + /*JP< 再読み込み閾値[byte]。データサイズがこの値以下になると読み込みを行います。 */ +} CriMvInputBufferInfo; + + +// TEMP: for internal use +typedef struct { + CriUint8 *imageptr; + CriUint32 bufsize; // [Byte] + CriUint32 line_pitch; // [Byte] + CriUint32 line_size; // [Byte] + CriUint32 num_lines; +} CriMvImageBufferInfo; + +/*EN + * \brief Video Frame Information + * \ingroup MDL_MV_INFO + * \sa CriMvEasyPlayer::GetFrameOnTimeAs32bitARGB(), CriMvEasyPlayer::GetFrameOnTimeAsYUVBuffers, + * CriMvEasyPlayer::GetFrameOnTimeAsYUV422(), CriMvEasyPlayer::DiscardNextFrame() + */ +/*JP + * \brief ビデオフレーム情報 + * \ingroup MDL_MV_INFO + * ビデオフレーム情報 + * \sa CriMvEasyPlayer::GetFrameOnTimeAs32bitARGB(), CriMvEasyPlayer::GetFrameOnTimeAsYUVBuffers, + * CriMvEasyPlayer::GetFrameOnTimeAsYUV422(), CriMvEasyPlayer::DiscardNextFrame() + */ +typedef struct { + CriUint8 *imageptr; /*EN< Pointer to image data */ + /*JP< 画像データのポインタ */ + CriSint32 frame_id; /*EN< Frame ID ot the playback */ + /*JP< フレーム識別ID(ループ/連結再生時は通算) */ + CriUint32 width; /*EN< Width of movie frame [pixel] (multiple of 8) */ + /*JP< ムービの横幅[pixel] (8の倍数) */ + CriUint32 height; /*EN< Height of movie frame [pixel] (multiple of 8) */ + /*JP< ムービの高さ[pixel] (8の倍数) */ + CriUint32 pitch; /*EN< Pitch of movie frame [byte]*/ + /*JP< ムービのピッチ[byte] */ + CriUint32 disp_width; /*EN< Width of the image to draw. */ + /*JP< 表示したい映像の横ピクセル数(左端から) */ + CriUint32 disp_height; /*EN< Height of the image to draw. */ + /*JP< 表示したい映像の縦ピクセル数(上端から) */ + CriUint32 framerate; /*EN< Frames per second times 1000 */ + /*JP< フレームレートの1000倍の値 */ + CriUint32 framerate_n; /*EN< Frame rate (in rational as numerator). framerate_n/framerate_d = framerate */ /* UTODO: 変数名 */ + /*JP< フレームレートの分子(有理数形式)。framerate_n/framerate_d = framerate */ + CriUint32 framerate_d; /*EN< Frame rate (in rational as denominator). */ + /*JP< フレームレートの分母(有理数形式)。 */ + CriUint64 time; /*EN< Frame time ('time / tunit' indicates time in seconds) */ + /*JP< 時刻。time / tunit で秒を表す。 */ + CriUint64 tunit; /*EN< Unit of time measurement */ + /*JP< 時刻単位 */ + CriUint32 cnt_concatenated_movie; /*EN< Number of concatenated movie data */ + /*JP< ムービの連結回数 */ + CriSint32 frame_id_per_data; /*EN< Frame ID of the movie data */ + /*JP< ムービデータごとのフレーム番号 */ + + CriBool csc_flag; /*EN< This is temporary variable. Please don't access. */ + /*JP< テスト中の変数です。アクセスしないでください。 */ + + CriMvAlphaType alpha_type; /*EN< Composite mode */ + /*JP< アルファの合成モード*/ + + void *details_ptr[CRIMV_FRAME_DETAILS_NUM]; // for internal use + + CriSint32 num_images; // TEMP: for internal use + CriMvImageBufferInfo image_info[4]; // TEMP: for internal use + + CriUint32 color_conversion_type; /*EN< Color space converion type. Fullrange or Limited.*/ + /*JP< 色変換タイプ。 */ + CriUint32 total_frames_per_data; /*EN< Total frames of the movie data*/ + /*JP< ムービデータ単位の総フレーム数 */ + CriUint32 cnt_skipped_frames; /*EN< Number of skipped frames to decode */ + /*JP< デコードスキップされたフレーム数 */ +} CriMvFrameInfo; + +/*EN + * \brief Subtitle Information + * \ingroup MDL_MV_INFO + * \sa CriMvEasyPlayer::GetSubtitleOnTime() + */ +/*JP + * \brief 字幕情報 + * \ingroup MDL_MV_INFO + * \sa CriMvEasyPlayer::GetSubtitleOnTime() + */ +typedef struct { + CriUint8 *dataptr; /*EN< Pointer to subtitle data */ + /*JP< 字幕データのポインタ */ + CriUint32 data_size; /*EN< Size of subtitle data */ + /*JP< 字幕データサイズ */ + CriSint32 channel_no; /*EN< Channel number of subtitle data */ + /*JP< 字幕データのチャネル番号 */ + CriUint64 time_unit; /*EN< Unit of time measurement */ + /*JP< 時刻単位 */ + CriUint64 in_time; /*EN< Display start time */ + /*JP< 表示開始時刻*/ + CriUint64 duration_time; /*EN< Display duration time */ + /*JP< 表示持続時間 */ + CriUint32 cnt_concatenated_movie; /*EN< Number of concatenated movie data */ + /*JP< ムービの連結回数 */ + CriUint64 in_time_per_data; /*EN< Display start time per movie data*/ + /*JP< ムービデータごとに表示開始時刻*/ +} CriMvSubtitleInfo; + +/*EN + * \brief Event Point Info + * \ingroup MDL_MV_INFO + * Event point info is the each timing info was embeded to movie data as cue point info. + * \sa CriMvEasyPlayer::GetCuePointInfo() + */ +/*JP + * \brief イベントポイント情報 + * \ingroup MDL_MV_INFO + * キューポイント機能でムービデータに埋め込まれた個々のタイミング情報です。 + * \sa CriMvEasyPlayer::GetCuePointInfo() + */ +typedef struct { + CriChar8 *cue_name; /*EN< The name string of event point. Char code depends on cue point text. */ + /*JP< イベントポイント名。文字コードはキューポイント情報テキストに従います。 */ + CriUint32 size_name; /*EN< The data size of name string */ + /*JP< イベントポイント名のデータサイズ */ + CriUint64 time; /*EN< Timer counter */ + /*JP< タイマカウント */ + CriUint64 tunit; /*EN< Counter per 1 second. "count / unit" indicates the timer on the second time scale. */ + /*JP< 1秒あたりのタイマカウント値。count ÷ unit で秒単位の時刻となります。 */ + CriSint32 type; /*EN< Event point type */ + /*JP< イベントポイント種別 */ + CriChar8 *param_string; /*EN< The string of user parameters. Char code depends on cue point text. */ + /*JP< ユーザパラメータ文字列。文字コードはキューポイント情報テキストに従います。 */ + CriUint32 size_param; /*EN< The data size of user parameters string */ + /*JP< ユーザパラメータ文字列のデータサイズ */ + CriUint32 cnt_callback; /*EN< The counter of calling cue point callback. */ + /*JP< キューポイントコールバックの呼び出しカウンタ */ +} CriMvEventPoint; + +/*EN + * \brief Cue Point Info + * \ingroup MDL_MV_INFO + * Cue point info includes the number of event points and the list. + * \sa CriMvEasyPlayer::GetCuePointInfo() + */ +/*JP + * \brief キューポイント情報 + * \ingroup MDL_MV_INFO + * キューポイント情報は、イベントポイントの個数と一覧です。
+ * \sa CriMvEasyPlayer::GetCuePointInfo() + */ +typedef struct { + CriUint32 num_eventpoint; /*EN< The number of event points */ + /*JP< イベントポイント個数 */ + CriMvEventPoint *eventtable; /*EN< The list of event points */ + /*JP< イベントポイント一覧 */ +} CriMvCuePointInfo; + +/*EN + * \brief YUV Texture Buffer Parameters + * \ingroup MDL_MV_INFO + * The output buffer parameters for CriMvEasyPlayer::GetFrameOnTimeAsYUVBuffers(). + * CriMvEasyPlayer::GetFrameOnTimeAsYUVBuffers() outputs data for pixel shader.
+ * If an application doesn't play alpha movie, CRI Movie library doesn't use alpha buffer parameters.
+ * \sa CriMvEasyPlayer::GetFrameOnTimeAsYUVBuffers() + */ +/*JP + * \brief YUV個別バッファ情報 + * \ingroup MDL_MV_INFO + * CriMvEasyPlayer::GetFrameOnTimeAsYUVBuffers() の出力バッファ情報です。
+ * CriMvEasyPlayer::GetFrameOnTimeAsYUVBuffers() はPixel Shader 向けのデコード結果を出力します。
+ * アルファムービ再生を行わない場合(不透明の通常再生)は、Alphaテクスチャ関連のパラメータは使用しません。
+ * \sa CriMvEasyPlayer::GetFrameOnTimeAsYUVBuffers() + */ +typedef struct { + CriUint8 *y_imagebuf; /*EN< Pointer to the buffer of Y texture */ + /*JP< Yテクスチャのバッファポインタ */ + CriUint32 y_bufsize; /*EN< Size of the buffer of Y texture [byte] */ + /*JP< Yテクスチャのバッファサイズ[byte] */ + CriUint32 y_pitch; /*EN< Pitch of the buffer of Y texture [byte] */ + /*JP< Yテクスチャのピッチ[byte] */ + CriUint8 *u_imagebuf; /*EN< Pointer to the buffer of U texture */ + /*JP< Uテクスチャのバッファポインタ */ + CriUint32 u_bufsize; /*EN< Size of the buffer of U texture [byte] */ + /*JP< Uテクスチャのバッファサイズ[byte] */ + CriUint32 u_pitch; /*EN< Pitch of the buffer of U texture [byte] */ + /*JP< Uテクスチャのピッチ[byte] */ + CriUint8 *v_imagebuf; /*EN< Pointer to the buffer of V texture */ + /*JP< Vテクスチャのバッファポインタ */ + CriUint32 v_bufsize; /*EN< Size of the buffer of V texture [byte] */ + /*JP< Vテクスチャのバッファサイズ[byte] */ + CriUint32 v_pitch; /*EN< Pitch of the buffer of V texture [byte] */ + /*JP< Vテクスチャのピッチ[byte] */ + CriUint8 *a_imagebuf; /*EN< Pointer to the buffer of Alpha texture */ + /*JP< Alphaテクスチャのバッファポインタ */ + CriUint32 a_bufsize; /*EN< Size of the buffer of Alpha texture [byte] */ + /*JP< Alphaテクスチャのバッファサイズ[byte] */ + CriUint32 a_pitch; /*EN< Pitch of the buffer of Alpha texture [byte] */ + /*JP< Alphaテクスチャのピッチ[byte] */ +} CriMvYuvBuffers; + + +/*EN + * \brief Playback Information + * \ingroup MDL_MV_INFO + * The output playback information of CriMvEasyPlayer::GetPlaybackInfo(). + * These parameters represents current movie playback information such as decode delay of movie data and + * interval of video frames retrieval. + * \sa CriMvEasyPlayer::GetPlaybackInfo() + */ +/*JP + * \brief 再生情報 + * \ingroup MDL_MV_INFO + * CriMvEasyPlayer::GetPlaybackInfo() の出力再生情報です。
+ * フレームの取得間隔やデコードの遅延などの現在再生しているムービの再生情報を表します。
+ * \sa CriMvEasyPlayer::GetPlaybackInfo() + */ +typedef struct { + CriUint64 cnt_app_loop; /*EN< Loop count of application. Precisely, this is a number of calls of CriMvEasyPlayer::Update(). The count up will start after app is able to acquire the first video frame */ + /*JP< アプリケーションのループカウント。具体的には CriMvEasyPlayer::Update() の呼び出し回数になります。最初のフレームが取得可能になるとカウントが始まります。*/ + CriUint64 cnt_frame_interval[4]; /*EN< Interval of video frames retrieval. These values are count up when CriMvEasyPlayer::IsNextFrameOnTime() returns TRUE. + * + * The interval of video frames retrieval indicates a number of the loop count when your application calls CriMvEasyPlayer::IsNextFrameOnTime() in the main loop. + * In case that the application waits for vertical retrace, 1 interval equals about 16.7 msec. + * The index of array represents the count of intervals as follows: + * + *
Index Interval of video frames retrieval + *
0 Every main loop + *
1 2 main loops + *
2 3 main loops + *
3 4 or more main loops + *
+ * With these values, you can check if the application gets video frames with appropriate intervals. Please use the values as measuring playback smoothness + * + * In order to use these values, the application must meet the following conditions: + * - The main loop should work periodically and stably (Ideally sync with vertical retrace) + * - The application should call CriMvEasyPlayer::IsNextFrameOnTime() once in everly main loop + * + * For example, if the application runs at 59.94fps by waiting for vertical retrace and a framerate of playing movie file is 29.97fps, + * only cnt_frame_interval[1] should be increased. + */ + /*JP< フレームの取得間隔。これらの値は、 CriMvEasyPlayer::IsNextFrameOnTime() がTRUEを返した時にカウントアップされます。
+ * + * フレームの取得間隔とは、アプリケーションがメインループ内でフレーム取得関数を読んだ時のループの回数を意味します。 + * メインループがVSyncと同期している場合は、1 Interval = 約16.7msecということになります。 + * 配列のインデックスは、以下のように取得間隔を表します。
+ * + *
インデックス フレームの取得間隔 + *
0 毎メインループ + *
1 2 メインループ + *
2 3 メインループ + *
3 4 メインループ以上 + *
+ * これらの値を見ることで、アプリが正しい間隔でフレームを取得できたのかどうかをチェックすることができます。ムービが滑らかに再生できているかの目安にしてください。
+ * + * ただし前提として、以下の条件をアプリが満たしている必要があります。 + * - アプリがVSyncなど、一定の周期で安定して動作している + * - メインループ内で毎回 CriMvEasyPlayer::IsNextFrameOnTime() を呼び出す + * + * 上記の条件下において、例えばアプリが59.94fpsで動作している状態で、フレームレートが29.97fpsのムービを再生した場合、cnt_frame_interval[1]のみが増え続けれれば + * 正しい間隔でフレームの取得が出来たことになります。 + */ + CriUint64 cnt_time_early; /*EN< A count of how many times CriMvEasyPlayer::IsNextFrameOnTime() returns FALSE due to the determination if it is the time to provide the next video frame */ + /*JP< CriMvEasyPlayer::IsNextFrameOnTime() が、フレーム表示時刻判定によりFALSEを返した回数。*/ + CriUint64 cnt_decode_delay; /*EN< A count of how many times CriMvEasyPlayer::IsNextFrameOnTime() returns FALSE due to the delay of decoding movie data */ + /*JP< CriMvEasyPlayer::IsNextFrameOnTime()が、ビデオフレームのデコード遅延によりFALSEを返した回数 */ + CriFloat32 time_max_delay; /*EN< Maximum delay time [msec] of the actual time a video frame retrieved against the original time should be retrieved */ + /*JP< ビデオフレームを取得した実際の時刻と、本来表示すべき時刻との最大遅延時間 [msec]。 */ + CriFloat32 time_average_delay; /*EN< Average delay time [msec] of the actual time a video frame retrieved against the original time should be retrieved */ + /*JP< ビデオフレームを取得した実際の時刻と、本来表示すべき時刻との平均遅延時間 [msec]。 */ +} CriMvPlaybackInfo; + +#if defined(XPT_TGT_PS3PPU) +/*EN + * \brief Parameters of SPURS and PPU for decoding + * \ingroup MDL_MV_BASIC + * + * \sa CriMv::SetupSpursParameters_PS3(), CriMv::CalcSpursWorkSize_PS3() + */ +/*JP + * \brief デコードに使うSPURSおよびPPUのパラメータ + * \ingroup MDL_MV_BASIC + * + * \sa CriMv::SetupSpursParameters_PS3(), CriMv::CalcSpursWorkSize_PS3() + */ +typedef struct { + void *spurs_handler; /*EN< SPURS handler */ + /*JP< SPURSハンドル */ + void *spurs_work; /*EN< SPURS work area. The size is spurs_worksize. The alignment is 128 byte. */ + /*JP< SPURS用ワークバッファ。バッファサイズは spurs_worksize で128バイト境界。 */ + CriSint32 spurs_worksize; /*EN< SPURS work size. This size is calculated by CriMv::CalcSpursWorkSize_PS3 function. */ + /*JP< SPURS用ワークサイズ。CriMv::CalcSpursWorkSize_PS3 関数で取得した値。 */ + CriSint32 spurs_max_contention; /*EN< SPURS max contention */ + /*JP< SPURS でムービデコード用に使うSPUの最大数 */ + CriUint8 *spurs_task_priority; /*EN< SPURS task priority x 8 */ + /*JP< SPURS のタスクプライオリティ配列。配列要素は8個。 */ + + CriUint32 ppu_num; /*EN< The number of PPU for decoding (0-2) */ + /*JP< The number of PPU for decoding (0-2) */ + CriSint32 ppu_thread_prio; /*EN< PPU Thread Priority. This priority is used for decoding thread in the case of ppu_num equal 2. */ + /*JP< PPU Thread Priority. この値は ppu_num に2を指定した場合に作成するスレッドに使われる。 */ +} CriMvProcessorParameters_PS3; + +// [NOT SUPPORT on normal library] +// for SPU Thread +typedef struct { + CriUint32 ppu_num; /* The number of PPU for decoding (0-2) */ + CriSint32 ppu_prio; /* PPU Thread Priority */ + CriUint32 spu_num; /* The number of SPU for decoding (0-6) */ + CriSint32 spu_grp_prio; /* SPU Thread Group Priority */ +} CriMvSpuThreadParameters_PS3; + +#endif + +#if defined(XPT_TGT_XBOX360) +/*EN + * \brief Parameters of Xbox360 processors for decoding + * \ingroup MDL_MV_BASIC + * + * \sa CriMvEasyPlayer::SetUsableProcessors_XBOX360() + */ +/*JP + * \brief デコードに使うXbox360プロセッサのパラメータ + * \ingroup MDL_MV_BASIC + * + * \sa CriMvEasyPlayer::SetUsableProcessors_XBOX360() + */ +typedef struct { + CriBool processor0_flag; /*EN< Processor 0 (Core 0, Thread 0) usable flag */ + /*JP< プロセッサ0 (コア0スレッド0) 使用可能フラグ */ + CriBool processor1_flag; /*EN< Processor 1 (Core 0, Thread 1) usable flag */ + /*JP< プロセッサ1 (コア0スレッド1) 使用可能フラグ */ + CriBool processor2_flag; /*EN< Processor 2 (Core 1, Thread 0) usable flag */ + /*JP< プロセッサ2 (コア1スレッド0) 使用可能フラグ */ + CriBool processor3_flag; /*EN< Processor 3 (Core 1, Thread 1) usable flag */ + /*JP< プロセッサ3 (コア1スレッド1) 使用可能フラグ */ + CriBool processor4_flag; /*EN< Processor 4 (Core 2, Thread 0) usable flag */ + /*JP< プロセッサ4 (コア2スレッド0) 使用可能フラグ */ + CriBool processor5_flag; /*EN< Processor 5 (Core 2, Thread 1) usable flag */ + /*JP< プロセッサ5 (コア2スレッド1) 使用可能フラグ */ + CriSint32 thread_priority; /*EN< Priority of decoding threads on the active processors */ + /*JP< 各プロセッサ上でデコード処理を行うスレッドの優先度 */ +} CriMvProcessorParameters_XBOX360; +#endif + +#if defined(XPT_TGT_VITA) +/*EN + * \brief AVC Decoder Parameters + * \ingroup MDL_MV_BASIC + * + * \sa CriMv::SetupAvcDecoderParameters_VITA() + */ +/*JP + * \brief AVCデコーダパラメータ + * \ingroup MDL_MV_BASIC + * + * \sa CriMv::SetupAvcDecoderParameters_VITA() + */ +typedef struct { + CriUint32 horizontal; /*EN< Maximum width for decoding (in pixel) */ + /*JP< 最大デコード画像の横幅 (単位:ピクセル) */ + CriUint32 vertical; /*EN< Maximum height for decoding (in pixel) */ + /*JP< 最大デコード画像の高さ (単位:ピクセル) */ + CriUint32 n_ref_frames; /*EN< Maximum reference frames on decoding (default:3) */ + /*JP< デコード時の最大参照画像の枚数 */ + CriUint32 n_decoders; /*EN< Maximum number of avc decoders (max:1) */ + /*JP< 同時に使用するAVCでコーダの最大数 (1固定) */ + +} CriMvAvcDecoderParameters_VITA; +#endif + +/*--------------------------------------------------------------------------*/ +/* */ +/*--------------------------------------------------------------------------*/ +typedef enum { + CRIMV_PCM_FORMAT_SINT16 = 0, + CRIMV_PCM_FORMAT_FLOAT32 = 1, + + /* Keep enum 4bytes */ + CRIMV_PCM_FORMAT__MAKE_ENUM_SINT32 = 0x7FFFFFFF +} CriMvPcmFormat; +/* + * \brief 16bit wave data information + * \ingroup MDL_MV_INFO + * Information about a 16-bit waveform. + */ +/* 16bit Waveform 情報 */ +typedef struct { + CriUint32 num_channel; /* Number of Channels. monaural = 1, stereo = 2 */ + /* Number of Channels. monaural = 1, stereo = 2 */ + CriUint32 num_samples; /* Number of sample */ + /* サンプル数 */ + CriUint32 sampling_rate; /* Sampling rate */ + /* サンプリング周波数 */ +} CriMvWaveInfo; + +/* オーディオヘッダ */ +typedef struct { + /* ストリーミングパラメータと共通 */ + CriUint32 sampling_rate; + CriUint32 num_channel; + CriUint32 total_samples; + CriUint32 codec_type; + + CriUint32 metadata_count; + CriUint32 metadata_size; + + /* ヘッダ固有 */ + CriUint32 a_input_xsize; +} CriMvPlyAudioHeader; + +/* ビデオヘッダ */ +typedef struct { + /* ヘッダ固有 */ + CriUint32 width; + CriUint32 height; + CriUint32 disp_width; + CriUint32 disp_height; + CriUint32 framerate_n; + CriUint32 framerate_d; + CriUint32 total_frames; + + CriUint32 material_width; /* width of video original source. 0 means no info. */ + CriUint32 material_height; /* height of video original source. 0 means no info. */ + CriUint32 screen_width; /* screen width for Wii */ + + CriUint32 codec_type; + CriUint32 codec_dc_option; /* 11 or 10 */ + + CriUint32 metadata_count; + CriUint32 metadata_size; + + CriUint32 pre_padding; + CriUint32 color_conversion_type; + CriSint32 max_picture_size; + CriSint32 average_bitrate; +} CriMvPlyVideoHeader; + +/* サブタイトルヘッダ */ +typedef struct { + CriBool is_subtitle_data; + CriUint32 num_channel; + CriUint64 time_unit; + CriUint32 max_subtitle_size; +} CriMvPlySubtitleHeader; + +/* キューポイントヘッダ */ +typedef struct { + CriBool is_cuepoint_data; + CriUint32 metadata_count; + CriUint32 metadata_size; + CriUint32 num_eventpoint; + CriUint64 time_unit; +} CriMvPlyCuePointHeader; + +/* アルファヘッダ */ +typedef struct { + /* ヘッダ固有 */ + CriUint32 width; + CriUint32 height; + CriUint32 disp_width; + CriUint32 disp_height; + CriUint32 framerate_n; + CriUint32 framerate_d; + CriUint32 total_frames; + + CriMvAlphaType alpha_type; + CriUint32 codec_type; + + CriUint32 metadata_count; + CriUint32 metadata_size; + + CriUint32 pre_padding; + CriUint32 color_conversion_type; + CriSint32 max_picture_size; + CriSint32 average_bitrate; +} CriMvPlyAlphaHeader; + +/* アルファのみのフレーム情報 */ +typedef struct { + CriUint8 *imageptr; /*EN< Pointer to image data */ + /*JP< 画像データのポインタ */ + CriSint32 frame_id; /*EN< Frame ID */ + /*JP< フレーム識別ID */ + CriUint32 width; /*EN< Width of movie frame [pixel] */ + /*JP< ムービの横幅[pixel] */ + CriUint32 height; /*EN< Height of movie frame [pixel] */ + /*JP< ムービの高さ[pixel] */ + CriUint32 disp_width; /*EN< Width of image [pixel] */ + /*JP< 有効な映像の横幅[pixel] */ + CriUint32 disp_height; /*EN< Height of image [pixel] */ + /*JP< 有効な映像の高さ[pixel] */ + CriUint32 pitch; /*EN< Pitch of movie frame [byte]*/ + /*JP< ムービのピッチ[byte] */ + CriUint64 time; /*EN< Frame time ('time / tunit' indicates time in seconds) */ + /*JP< 時刻。time / tunit で秒を表す。 */ + CriUint64 tunit; /*EN< Unit of time measurement */ + /*JP< 時刻単位 */ + CriSint32 frame_id_per_data; /*EN< Frame ID of the movie data */ + /*JP< ムービデータごとのフレーム番号 */ + CriMvAlphaType alpha_type; /*EN< Composite mode */ + /*JP< アルファの合成モード*/ + void *detail_ptr; /* TEMP: for internal use */ + CriUint32 color_conversion_type; /*EN< Color space converion type. Fullrange or Limited.*/ + /*JP< 色変換タイプ。 */ +} CriMvAlphaFrameInfo; + +// 内部管理用。ムービ情報をユーザに渡す時はこれとほぼ同じだろうか。 +/* Information of USF File */ +typedef struct { + CriBool is_usf_file; + CriUint32 max_chunk_size; + CriUint32 min_buffer_size; + CriUint32 bitrate; + CriUint32 format_version; + /* Video */ + CriUint32 num_video; + CriMvPlyVideoHeader videohead[CRIMV_MAX_VIDEO_NUM]; + /* Audio */ + CriUint32 num_audio; + CriMvPlyAudioHeader audiohead[CRIMV_MAX_AUDIO_NUM]; + /* Subtitle */ + CriUint32 num_subtitle; + CriMvPlySubtitleHeader subtitlehead; + /* Alpha */ + CriUint32 num_alpha; + CriMvPlyAlphaHeader alphahead[CRIMV_MAX_ALPHA_NUM]; + /* CuePoint */ + CriUint32 num_cuepoint; + CriMvPlyCuePointHeader cuepointhead; +} CriMvPlyHeaderInfo; + +/* Video Elementary Stream */ +typedef struct { + CriUint32 fcid; + CriSint32 track_no; // チャンクのチャネル番号 + void *vdec; +} CriMvPlyVideo; + +typedef struct { + CriUint32 fcid; + CriSint32 track_no; // チャンクのチャネル番号 + void *dec; +} CriMvPlyAlpha; + +/* ムービヘッダを管理するための構造体 */ +typedef struct { + CriMvPlyHeaderInfo info; + CriBool write_new_head_flag; // CRIDが見つかって次のヘッダを書き込む準備ができたか? + CriUint32 num_remaining_adec_head; // 必要な残りのオーディオヘッダの数 + CriUint32 num_remaining_vdec_head; // 必要な残りのビデオのヘッダの数 + CriUint32 num_remaining_subtitle_head; // 必要な残りの字幕のヘッダの数 + CriUint32 num_remaining_alpha_head; // 必要な残りのアルファのヘッダ数 + CriUint32 num_remaining_cuepoint_head; // 必要な残りのキューポイントのヘッダ数 + /* 2010-08-19: TEMP: CONCAT_KAI: Don't refer this member. */ + CriUint64 accumulated_tcount; +} CriMvHeaderInfoContainer; + +typedef struct { + CriBool is_play_audio; + CriUint32 fcid; + CriUint32 track_no; // チャンクのチャネル番号 + void *adec; // 実際のオーディオコーデック + CriUint32 num_channel; // データのチャネル数 + CriUint32 sampling_rate; // サンプリング周波数 + CriUint32 output_buffer_samples; + CriSj sji; // UNI + CriSj sjo[CRIMV_PCM_BUFFER_MAX]; // RBF + CriUint32 sjo_bufsize[CRIMV_PCM_BUFFER_MAX]; + CriBool term_supply; // データ供給終了通知フラグ + CriBool is_working; // コンテンツチャンク処理中 + +#if defined(ENABLE_DYNAMIC_AUDIO_SWITCH) + CriUint32 next_track_no; // ユーザが指定した切替先のトラック番号 + CriUint32 last_track_switch_time; // 切替元のトラックの最後にチャンクをとった時刻 + CriUint32 last_track_switch_tunit; // 上記時刻の単位 (in Hz?) + CriMvPlyAmngTrackState switch_state; // トラック切替による状態 +#endif +} *CriMvPlyAdec, CriMvPlyAdecObj; + +typedef struct { + + CriMvPlyAdec mvply_adecs[NUM_MAX_ADEC]; + CriSint32 num_adecs; + CriUint32 size_smpl; + CriSj sji; + CriUint32 chunk_num_per_server; + + CriBool (*cbfunc_nofify_found_header)(void *usrobj, CriChunk *ckc, CriUint8 chno); + void *usrobj_nofify_found_header; + +} *CriMvPlyAmng, CriMvPlyAmngObj; + + +/* シークブロック情報 */ +typedef struct { + CriSint32 top_frame_id; +} CriMvSeekBlockInfo; + +/* ストリーマ用情報 */ +typedef struct { + CriUint32 max_chunk_size; + CriUint32 average_bitrate; +} CriMvStreamerInfo; + + +/* ハンドル作成用コンフィグ構造体 */ +typedef struct { + CriUint32 readbuffer_size; +} CriMvHandleConfig; + + +/*JP CRI Movie ハンドル */ +/*EN + * A handle for a single movie. If multiple movies are to be played simultaneously, + * create a CriMvPly handle for each movie. + * + * \sa criMvPly_Create(), criMvPly_Destroy() */ +typedef struct { + /*** Member variable is ***/ + CriBool used; + CriMvPlyStatus stat; + CriBool request_stop; + CriBool restrain_supply; + CriBool term_supply; + void *cs_work; + void *cshn; + /* USF Header */ + + CriMvHeaderInfoContainer headinfo_container[CRIMVPLY_HEAD_CONTAINER_NUM]; + Uint16 cur_dechead_idx; + CriUint32 cnt_dechead; /* ヘッダ解析ごとに更新 */ + CriUint32 cnt_concat; /* GetFrameで更新 */ + + CriMvPlyHeaderInfo headinfo; + CriUint32 num_headck; /* ヘッダ解析処理したチャンク数 */ + CriFloat32 def_buffering_time; + CriUint32 def_max_stream; + CriUint32 def_sound_output_buffer_samples; + CriSint32 def_track_play_audio; /* -1 でオーディオ再生無し */ + + /* デリゲートパラメータ構造体 */ + CriSint32 size_dlgparams; + CriUint8 *ptr_dlgparams; + + CriBool is_prepare_work; + CriMvStreamingParameters stmprm; /* ストリーミングパラメータの記録 */ + /* Demultiplexer */ + CriSint32 inputtype; /* ストリーミングかメモリか?メモリ=ユニSJ再生 */ + CriBool is_usf_data; /* 入力ファイルはUSFファイルか? */ + void *demux; /* USFデマルチプレクサハンドル */ + CriUint32 max_demuxout; /* デマルチプレクサ出力の最大種別数 */ + CriUint32 num_demuxout; /* デマルチプレクサ出力に設定済みの種別数 */ + CriSj headanaly_in_sj; // RBF + CriSj headanaly_out_sj; // UNI + CriSj read_sj; // RBF + CriChunk readck; + + CriSj memplay_sj; // UNI (for memory playback) + CriChunk movie_on_mem; /* メモリ指定のムービデータ記憶用(1個) */ + CriUint32 offset_content; /* メモリ指定先頭データのコンテンツ本体までのサイズ */ + + /* === ハンドル作成時に確保 === */ + CriHeap heap_gen; + /* ヘッダ解析用の読み込み領域 */ + CriUint32 headanaly_bufsize; + /* ハンドル内部メモリは最初に10kbyte確保して使いまわす。具体的にはヘッダ解析用。 */ + CriHeap local_heap; /* ハンドル内部専用Heap */ + CriSint32 local_bufsize; /* ハンドル内部専用Heap用のバッファサイズ */ + CriUint8 *local_bufptr; /* ハンドル内部専用Heap用のバッファポインタ */ + /* === メタワークバッファ (ヘッダ解析時に確保) === */ + CriHeap heap_meta; + /* === ワークバッファ作成時に確保 === */ + CriHeap heap_core; + /* 読み込みバッファ */ + CriUint32 size_readbuf_main; + CriUint32 size_readbuf_ext; + /* Video Decoder */ + CriMvPlyVideo video; + CriUint32 framerate_n; + CriUint32 framerate_d; + /* Audio Decoder */ + CriMvPlyAmng audio_mngr; + CriMvPcmFormat pcmfmt; + CriUint32 size_smpl; + CriHeap heap_audio2; + /* Subtitle */ + CriSj sjo_subtitle; + CriSint32 concat_subtitle_cnt; /* 字幕の連結処理回数 */ + CriSint32 ch_subtitle; /* 字幕の連結処理回数 */ + /* Alpha */ + CriMvPlyAlpha alpha; + + /* 折り返しチャンク対応用(使うかどうかに関係なく変数だけは定義する) */ + CriUint32 bufsize_read_main; /* 入力SJのバッファ本体サイズ */ + CriUint32 bufsize_read_ext; /* 入力SJののりしろサイズ */ + CriUint8 *read_sj_bufptr; /* 入力RBSJの先頭バッファアドレス */ + + /* ストリーミングパラメータに入れるという手段もアリかも? */ + CriSint32 seek_frame_id; /* シークしたいフレームID(GOPの途中の可能性あり) */ + CriSint32 video_gop_top_id; /* シーク後のビデオGOP先頭フレームID : 0以下でシーク無し */ + CriSint32 alpha_gop_top_id; /* シーク後のアルファGOP先頭フレームID : 0以下でシーク無し */ + CriBool seek_video_prep_flag; /* シーク再生のビデオ準備完了フラグ(GOP途中まで進んだか?) */ + CriBool seek_alpha_prep_flag; /* シーク再生のアルファ準備完了フラグ(GOP途中まで進んだか?) */ + CriBool seek_audio_prep_flag; /* シーク再生のオーディオ準備完了フラグ(シーク指定時刻まで捨てたか?) */ + + CriSint32 dechdr_stage; /* DECHDRの進み具合 */ + CriSint32 sji_meta_bufsize; /* メタデータ用入力バッファサイズ */ + CriSj sji_meta; /* メタデータ用入力SJ */ + CriUint32 cnt_meta_ck; /* メタデータ用入力SJ */ + void *video_seektbl_ptr; + CriUint32 video_seektbl_size; + CriSint32 video_gop_num; + void *alpha_seektbl_ptr; + CriUint32 alpha_seektbl_size; + CriSint32 alpha_gop_num; + + void *audio_header_ptr[CRIMV_MAX_AUDIO_NUM]; + CriUint16 audio_header_size[CRIMV_MAX_AUDIO_NUM]; + + void *cuepoint_meta_ptr; + CriUint32 cuepoint_meta_size; + CriMvCuePointInfo cuepoint_info; + + CriMvInputBufferInfo ibuf_info; + CriFloat32 reload_sec_threshold; + + CriSint32 num_frames_for_prep; + + /* For Sofdec2 */ + CriHeap heap_playback; + CriMvMetaDataWorkMallocFunc cbfunc_meta_alloc; + CriMvMetaDataWorkFreeFunc cbfunc_meta_free; + void* usrobj_meta_data; + void* meta_data_work_allocated; /* ユーザアロケータで確保されたメタデータワーク */ + void* event_table_work_allocated; /* ユーザアロケータで確保されたイベントテーブル */ + CriMvStreamerInfo streamer_info; + + /* OUTER_FRAMEPOOL_WORK */ + CriMvFramepoolWorkMallocFunc cbfunc_framepool_alloc; + CriMvFramepoolWorkFreeFunc cbfunc_framepool_free; + void* usrobj_framepool; + void* framepool_work_allocated; /* ユーザアロケータで確保されたフレームプールワーク(解放必要) */ + void* framepool_work_set; /* 直接バッファ指定されたフレームプールワーク(解放不要) */ + + /* For Debug */ + volatile CriUint8 end_sequence_info; + CriUint64Adr header_ptr; + CriSint64 header_size; + CriUint64Adr body_ptr; + CriSint64 body_size; + + CriBool sync_flag; + + CriBool error_flag; + +#if defined(XPT_TGT_IOS) + CriChar8 vavfios_filepath[CRIMVPLY_VAVFIOS_MAX_FILEPATH]; +#endif + + /* For Tools */ + void *extended_mvinfo_config; + + /* ハンドル作成コンフィグ関連 */ + CriBool use_hn_config_flag; /* ハンドル作成コンフィグ指定があったかどうか */ + CriMvHandleConfig hn_config; + +} *CriMvPly, CriMvPlyObj; + +/*************************************************************************** + * Function Declaration + ***************************************************************************/ + +#ifdef __cplusplus +extern "C" { +#endif + +/* ライブラリ初期化 */ +/* + * \brief ライブラリの初期化 + * \param なし + * \return なし + * \par 説明: + * ライブラリの初期化を行います。
+ * 複数回連続で初期化した場合は、最初の1回のみ初期化処理を実行します。 + */ +/* + * \ingroup MODULE_INIT + * \brief Initialize library + * + * This function initializes the CRI Movie library, including internal audio, + * streaming and video subsystems. This function must be + * called before any other function in this library will work properly. + * This function initializes only the first time it is called; if it is + * called again, it simply increments an internal counter and returns; it + * does not re-initialize, nor does it create an error condition. + * + * Therefore, it is safe to call criMvPly_Initialize() and criMvPly_Finalize() + * at the beginning and end, respectively, within each of the independent + * modules in your program. If you match these functions call for call, + * only the first criMvPly_Initialize() function and the last criMvPly_Finalize() + * functions should have any effect. + * + * \sa criMvPly_Finalize() + */ +void CRIAPI criMvPly_Initialize(void); + +/* ライブラリ終了 */ +/* + * \brief ライブラリ終了 + * \param なし + * \return なし + * \par 説明: + * ライブラリの終了処理を行います。
+ * 複数回初期化をしていた場合は、同じ回数だけ終了処理を実行してください。 + */ +/* + * \ingroup MODULE_INIT + * \brief Finalize library + * + * This function deallocates any resources in use by the library. + * It should be called the same number of times that the criMvPly_Initialize() + * function is called. If the criMvPly_Initialize() function is called n + * times, on the nth time the criMvPly_Finalize() function is called, + * criMvPly_Finalize() releases any resources allocated by CRI Movie. + * + * Therefore, it is safe to call criMvPly_Initialize() and criMvPly_Finalize() + * at the beginning and end, respectively, within each of the independent + * modules in your program. If you match these functions call for call, + * only the first criMvPly_Initialize() function and the last criMvPly_Finalize() + * functions should have any effect. + * + * \sa criMvPly_Initialize() + */ +void CRIAPI criMvPly_Finalize(void); + +/* ハンドル作成 */ +/* + * \brief ハンドル作成 + * \param heap : メモリ確保に使用するHeapハンドル + * \return CriMvPlyハンドル + * \par 説明: + * CRI Movie ハンドルを作成します。
+ * 必要なハンドル管理領域はHeapハンドルを使って自動的に確保します。
+ * 作成直後のハンドル状態はSTOP状態です。 + */ +/* + * \ingroup MODULE_INIT + * \brief Create a handle + * \param heap A valid CriHeap handle + * \return A valid CriMvPly handle, or NULL if the handle cannot be allocated + * + * This function creates a CriMvPly handle in the CRIMVPLY_STATUS_STOP state. + * Memory for the handle is allocated from the CriHeap structure that you provide. + * Any memory allocation failure during this function results in a text error message to output, and the program hangs. + * Make sure to initialize and create your heap with criHeap_Initialize() and + * criHeap_Create() before calling this function. + * + * \sa CriMvPly, CriMvPlyStatus, criHeap_Initialize(), criHeap_Create() + */ +CriMvPly CRIAPI criMvPly_Create(CriHeap heap); + +/* コンフィグ指定のハンドル作成 */ +/* config がNULL指定の場合はコンフィグ指定無しと同様 */ +CriMvPly CRIAPI criMvPly_CreateWithConfig(CriHeap heap, CriMvHandleConfig *config); + +/* ハンドル破棄 */ +/* + * \brief ハンドル破棄 + * \param mvply : CRI Movie ハンドル + * \return なし + * \par 説明: + * CRI Movie ハンドルの破棄を行います。
+ * ハンドル作成時に引数で指定したHeapハンドルを使って、ハンドル管理領域を解放します。
+ * ワークバッファを確保したままの場合は、ワークバッファ確保時に指定したHeapハンドルを使ってワークバッファも解放します。
+ * ハンドルの破棄は、ハンドル状態がSTOPかPLAYENDの時にしか実行できません。 + */ +/* + * \ingroup MODULE_INIT + * \brief Destroy a handle + * \param mvply A valid CriMvPly handle to be destroyed + * + * This function destroys the CriMvPly handle previously created + * with criMvPly_Create(). + * + * You can only destroy the handle if it is in either the CRIMVPLY_STATUS_STOP or the + * the CRIMVPLY_STATUS_PLAYEND states. Attempting to destroy the handle in + * any other state will produce an error message. You can check the status of + * the handle at any time with criMvPly_GetStatus(). + * + * Any work buffers allocated via criMvPly_AllocateWorkBuffer(), if they are + * still associated with the handle, are freed when criMvPly_Destroy() is called. + * + * \sa CriMvPly, CriMvPlyStatus, criMvPly_GetStatus(), criMvPly_AllocateWorkBuffer() + */ +void CRIAPI criMvPly_Destroy(CriMvPly mvply); + +/* ストリーミングパラメータの取得 */ +/* + * \brief ストリーミングパラメータの取得 + * \param mvply : CRI Movie ハンドル + * \param stmprm : ストリーミングパラメータ + * \return なし + * \par 説明: + * ヘッダ解析の結果をもとに、ムービ再生に必要なストリーミングパラメータを取得します。
+ * ハンドル状態がWAIT_PREPになると取得できるようになります。
+ * このパラメータをもとにcriMvPly_AllocateWorkBuffer関数を呼び出すことができます。
+ * 必要ならばこのパラメータの値を変更して、例えば音ありムービで音を再生しない、といったことも可能です。
+ */ +/* + * \ingroup MODULE_BUFFER + * \brief Get streaming parameters + * \param mvply A valid CriMvPly handle + * \param stmprm An empty CriMvStreamingParameters structure to be filled with data + * + * This function permits you to get detailed information about the stream and + * dynamically allocate resources just before the video and audio sequence + * begins playback. + * + * This function does nothing if the current state of the CriMvPly handle is + * CRIMVPLY_STATUS_DECHDR or CRIMVPLY_STATUS_STOP. The only useful state in + * which to call criMvPly_GetStreamingParameters() is the CRIMVPLY_WAIT_PREP + * status. When the CriMvPly handle is in the CRIMVPLY_WAIT_PREP status, + * calling this function will cause the CriMvStreamingParameters field to be + * filled with data. + * + * Some of the CriMvStreamingParameters, such as buffering time and the + * maximum number of files to read, are copied from the CriMvPly structure. + * However, maximum bitrate, video size, audio stream rate and channel + * info are calculated from the incoming stream. + * + * After calling criMvPly_GetStreamingParameters(), you can programmatically + * override any of the fields in the CriMvStreamingParameters struct yourself + * before calling criMvPly_AllocateWorkBuffer() with it. For example, you might + * need to read a stream containing both audio and video, but only output the + * video from the stream. In this case you could allocate trivial audio buffers + * for output by modifying the CriMvStreamingParameters struct accordingly after + * calling this function. + * + * \sa criMvPly_AllocateWorkBuffer(), CriMvPly, CriMvStreamingParameters + */ + void CRIAPI criMvPly_GetStreamingParameters(CriMvPly mvply, CriMvStreamingParameters *stmprm); + +/* ワークバッファの確保 */ +/* + * \brief ワークバッファの確保 + * \param mvply : CRI Movie ハンドル + * \param heap : + * \param stmprm : ストリーミングパラメータ + * \return なし + * \par 説明: + * 引数のHeapハンドルを使って、読み込みバッファやビデオ/オーディオのワークバッファを確保します。
+ * この関数を呼び出し可能なのは、STOP状態かWAIT_PREP状態の時のみです。
+ * 同じハンドルに対して2度呼び出すと、1度目のワークバッファを全て解放してから、改めてワークバッファを確保します。
+ * criMvPly_Start関数よりも先にワークバッファを確保しておくこともできます。 + */ +/* + * \ingroup MODULE_BUFFER + * \brief Allocate internal streaming work buffers + * \param mvply A CriMvPly handle + * \param heap A CriHeap handle + * \param stmprm An initialized CriMvStreamingParameters structure + * + * This function allocates internal streaming buffers for the CriMvPly movie + * player from the CriHeap. The amount of memory required is based + * on the maximum bitrate of the stream, the requested buffering time, the + * maximum chunk size, and the height and width of the incoming video frame. + * However, a small amount of memory is allocated for the + * video and audio decoders from the CriHeap as well. + * + * The CriHeap handle passed as a parameter to this function need not + * be the same CriHeap handle you passed to the criMvPly_Create() function. + * You may prefer to use either one or two heaps. + * + * This function can be called only if the CriMvPly handle is in the + * CRIMVPLY_STATUS_STOP or the CRIMVPLY_STATUS_WAIT_PREP status. Calling + * this function any other time will produce an error message. + * + * If this function is called twice without calling criMvPly_FreeWorkBuffer(), + * it releases the previously allocated buffers before allocating them again. + * + * This function must be called sometime before criMvPly_Start(). + * + * \if ps2 + * \par PS2 only: + * The PS2 implementation of this function additionally allocates buffers for + * internal DMA tags. If these allocations fail due to lack of memory, the + * library will hang. + * \endif + * + * \sa CriMvPly, CriHeap, CriMvPlyStatus, CriMvStreamingParameters, criMvPly_FreeWorkBuffer(), + * criMvPly_Start() + */ +CriBool CRIAPI criMvPly_AllocateWorkBuffer(CriMvPly mvply, CriHeap heap, CriMvStreamingParameters *stmprm); + +/* ワークバッファの解放 */ +/* + * \brief ワークバッファの解放 + * \param mvply : CRI Movie ハンドル + * \return なし + * \par 説明: + * criMvPly_AllocateWorkBuffer関数で確保したワークバッファを全て解放します。
+ * この関数を呼び出し可能なのは、STOP/WAIT_PREP/PLAYEND状態の時のみです。
+ * CRI Movie Ver.0.60 では未実装です。 + */ +/* + * \ingroup MODULE_BUFFER + * \brief Release streaming work buffer + * \param mvply A valid CriMvPly handle + * + * This function releases streaming work buffers allocated from the CriHeap + * previously associated with criMvPly_AllocateWorkBuffer(). + * This function should only be called at CRIMVPLY_STATUS_STOP, + * CRIMVPLY_STATUS_WAIT_PREP or CRIMVPLY_STATUS_PLAYEND states. However, this + * function does not verify the current stream status before releasing + * all the buffers; it merely deallocates them. Expect interesting crashes + * if you call this function while playing a movie. + * + * You can verify the current CriMvPly handle status with criMvPly_GetStatus() if + * necessary. + * + */ +void CRIAPI criMvPly_FreeWorkBuffer(CriMvPly mvply); + +/* 再生するオーディオチャネルの設定 */ +/* + * \brief 再生するオーディオチャネルの設定 + * \param mvply : CRI Movie ハンドル + * \param ch : オーディオチャネル番号 + * \return なし + * \par 説明: + * CriMvStreamingParameters構造体のメンバ track_play_audioのデフォルト値を設定します。
+ * criMvPly_GetStreamingParameters関数でCriMvStreamingParameters構造体を取得したときにこの値が格納されます。
+ * 何も設定していない場合、buffering_timeには0が入います。 + * -1を指定するとオーディオを再生しない設定になります。 + */ +void CRIAPI criMvPly_SetAudioTrack(CriMvPly mvply, CriSint32 track); + +/* バッファリング時間(単位[sec])の設定 */ +/* + * \brief バッファリング時間(単位[sec])の設定 + * \param mvply : CRI Movie ハンドル + * \param time : バッファリング時間 + * \return なし + * \par 説明: + * CriMvStreamingParameters構造体のメンバbuffering_timeのデフォルト値を設定します。
+ * criMvPly_GetStreamingParameters関数で CriMvStreamingParameters構造体を取得したときにこの値が格納されます。
+ * 何も設定していない場合、buffering_timeには1.0秒が入っています。 + */ +/* + * \ingroup MODULE_BUFFER + * \brief Set default buffering time (unit[sec]) + * \param mvply A valid CriMvPly handle + * \param time Buffering time in seconds + * + * This function tells the CriMvPly handle how much time of the stream to buffer in + * memory. Buffering is necessary to cover seeks, error retries, latency and + * other various hiccups in most data sources. + * + * This value is stored in the buffering_time field of the CriMvStreamingParameters + * struct. It is set to a default of 1.0 seconds when the CriMvPly handle is created. + * This is typically safe for most DVD type file systems. + * + * \sa CriMvPly, CriMvStreamingParameters + */ +//void CRIAPI criMvPly_SetBufferingTime(CriMvPly mvply, CriFloat32 time); + +/* 同時読み込みファイル数の設定 */ +/* + * \brief 同時読み込みファイル数の設定 + * \param mvply : CRI Movie ハンドル + * \param max_stm : 同時読み込みファイル数 + * \return なし + * \par 説明: + * CriMvStreamingParameters構造体のメンバmax_simultaneous_read_filesのデフォルト値を設定します。
+ * criMvPly_GetStreamingParameters関数で CriMvStreamingParameters構造体を取得したときにこの値が格納されます。
+ * 何も設定していない場合、max_simultaneous_read_filesには1が入っています。 + */ +/* + * \ingroup MODULE_BUFFER + * \brief Set maximum number of simultaneous streams + * \param mvply A valid CriMvPly handle + * \param max_stm The maximum number of simultaneous streams + * + * This function sets the default value of the "max_simultaneous_read_files" field of + * the CriMvStreamingParameters struct. Currently, setting this value has no effect. + */ +//void CRIAPI criMvPly_SetMaxSimultaneousStreams(CriMvPly mvply, CriUint32 max_stm); + +/* サウンド出力バッファサンプル数の設定 */ +/* + * \brief GetWave16で要求する最大サンプル数の設定 + * \param mvply : CRI Movie ハンドル + * \param max_smpl : 最大サンプル数 + * \return なし + * \par 説明: + * CriMvAudioParameters構造体のメンバoutput_buffer_samplesのデフォルト値を設定します。
+ * criMvPly_GetStreamingParameters関数で CriMvStreamingParameters構造体を取得したときにこの値が格納されます。
+ * 何も設定していない場合、output_buffer_samplesには16*1024が入っています。 + */ +/* + * \ingroup MODULE_AUDIO + * \brief Set default sound output buffer samples + * \param mvply A valid CriMvPly handle + * \param smpls : sound output buffer samples + * + * This function sets the default value of the "output_buffer_samples" field in the + * CriMvAudioParameters struct. The default value is 16384, which is set when + * criMvPly_Create() is called. + * + * This function only has an effect if it is called before the + * criMvPly_AllocateWorkBuffer() function is called, since this is when the audio + * output buffer is allocated. + * + * \sa CriMvAudioParameters, criMvPly_Create(), criMvPly_AllocateWorkBuffer(), + * criMvPly_GetWave16() + */ +//void criMvPly_SetMaxSamplesOfGetWave16(CriMvPly mvply, CriUint32 max_smpl); +void CRIAPI criMvPly_SetSoundOutputBufferSamples(CriMvPly mvply, CriUint32 smpls); + +/* ハンドル状態の取得 */ +/* + * \brief ハンドル状態の取得 + * \param mvply : CRI Movie ハンドル + * \return ハンドル状態 + * \par 説明: + * ハンドル状態を取得します。 + */ +/* + * \ingroup MODULE_STATE + * \brief Get the handle status + * \param mvply A valid CriMvPly handle + * \return One of the CriMvPlyStatus enum values + * + * This function gets the current status of the CRI Movie handle. Check the + * following link for possible return values. + * + * \sa CriMvPlyStatus + */ +CriMvPlyStatus CRIAPI criMvPly_GetStatus(CriMvPly mvply); + +/* WAIT状態から次の状態への遷移通知 */ +/* + * \brief WAIT状態から次の状態への遷移通知 + * \param mvply : CRI Movie ハンドル + * \return なし + * \par 説明: + * ハンドル状態をWAIT_**** 状態から次の状態に遷移させます。状態に応じて次のように使用します。
+ * ・WAIT_PREP 状態 : criMvPly_AllocateWorkBuffer関数でワークを確保しおわったら呼び出してください。
+ * ・WAIT_PLAYING 状態 : ビデオフレーム、オーディオデータを取得して表示・出力の準備ができたら、 + * 出力を開始して、本関数を呼び出してください。
+ * ・WAIT_PLAYEND 状態 : 最後のビデオフレームの表示、最後のオーディオデータの出力が終了したら呼び出してください。
+ * ・WAIT_STOP 状態 : ビデオやオーディオの出力が停止してもいい状態になったら、呼び出してください。
+ * 本関数を呼び出すと各状態は即座に次の状態に遷移します。
+ * 本関数を WAIT_**** 以外の状態で呼び出しても、状態は何も変わりません。 + */ +/* + * \ingroup MODULE_STATE + * \brief Notify transition from WAIT status + * \param mvply A valid CriMvPly handle + * + * This function notifies the CriMvPly handle that your application is ready to + * go from the current WAIT state to the next state. There are exactly four states + * in which it is appropriate to call this function: + * + * - CRIMVPLY_STATUS_WAIT_PREP After your application has allocated buffers with + * criMvPly_AllocateWorkBuffer() + * - CRIMVPLY_STATUS_WAIT_PLAYING After your application has prerolled stream data (if + * necessary) + * - CRIMVPLY_STATUS_WAIT_PLAYEND After your application has displayed the last frames of audio and + * video from the stream + * - CRIMVPLY_STATUS_WAIT_STOP After your application suspends playback from the stream + * + * You can check the current status of the CriMvPly handle by calling the criMvPly_GetStatus() + * function. This function has no effect if called in states other than those listed above. + * + * \sa CriMvPly, CriMvPlyStatus + */ +void CRIAPI criMvPly_IncrementState(CriMvPly mvply); + +/* 状態の更新 */ +/* + * \brief CriMvPlyモジュールのサーバ関数 + * \param mvply : CRI Movie ハンドル + * \return なし + * \par 説明: + * 主にデマルチプレクサ内部のデータの更新を行います。
+ * 本関数はアプリケーションのメインスレッド側でで毎回呼び出すようにしてください。
+ */ +void CRIAPI criMvPly_Update(CriMvPly mvply); + +/* 再生開始 */ +/* + * \brief 再生開始 + * \param mvply : CRI Movie ハンドル + * \return 再生開始できた場合はCRI_TRUE, 失敗した場合はCRI_FALSE + * \par 説明: + * 再生のための処理を開始します。
+ * 本関数呼出し後、ハンドル状態はDECHDRに遷移します。
+ */ +/* + * \ingroup MODULE_STATE + * \brief Start of playback processing + * \param mvply A valid CriMvPly handle + * + * This function initiates playback processing. This function should be called + * after the CriMvPly handle is created and the data source has been opened, + * but before the work buffers are allocated with criMvPly_AllocateWorkBuffer(). + * This function sets the current status of the CriMvPly handle to + * CRIMVPLY_STATUS_DECHDR, which prepares it to decode the header information + * from the data source. + * + * \sa CriMvPly, CriMvPlyStatus, criMvPly_AllocateWorkBuffer() + */ +CriBool CRIAPI criMvPly_Start(CriMvPly mvply); + +/* 再生停止リクエスト(即時復帰) */ +/* + * \brief 再生停止リクエスト(即時復帰) + * \param mvply : CRI Movie ハンドル + * \return なし + * \par 説明: + * 再生停止のリクエストを発行して即時復帰します。
+ * 本関数呼出し後、ハンドル状態はSTOP_PROCESSING状態に遷移します。
+ * 停止のための処理が終わると、ハンドル状態がWAIT_STOPに遷移します。
+ * WAIT_STOP状態になったら、criMvPly_IncrementState関数でSTOP状態に遷移させて、 + * アプリケーションの停止処理を行ってください。 + */ +/* + * \ingroup MODULE_STATE + * \brief Non-blocking request to stop playback + * \param mvply A currently playing CriMvPly handle + * + * This function records a request to terminate playback. Termination of + * playback is not synchronous to this function; this function sets the current + * state of the CriMvPly handle to CRIMVPLY_STATUS_STOP_PROCESSING. After + * movie processing is halted, the state of the handle transitions to + * CRIMWPLY_STATUS_WAIT_STOP. + * + * This function is useful for prematurely terminating a movie, e.g. "press + * X to skip this movie". + * + * Video frames will keep being delivered until you detect a CRIMVPLY_STATUS_WAIT_STOP + * state in the CriMvPly handle, and then call criMvPly_IncrementState to transition + * back to the CRIMVPLY_STATUS_STOP state. + * + * \note Pausing is not accomplished through this function. The system clock, including + * whether or not to pause or advance frames, is controlled entirely through user + * code. So the effect of "pausing" a CriMvPly handle can be accomplished by simply + * not updating your system clock as long as your pause is in effect. + * + * \sa CriMvPly, CriMvPlyStatus + */ +void CRIAPI criMvPly_Stop(CriMvPly mvply); + +/* サーバ処理(ハンドル指定) */ +/* + * \brief サーバ処理(ハンドル指定) + * \param mvply : CRI Movie ハンドル + * \return なし + * \par 説明: + * CRI Movie ハンドルを指定してサーバ処理を実行します。
+ * 各WAIT_**** 状態への状態遷移はサーバ関数内で実行されます。 + */ +/* + * \ingroup MODULE_VIDEO + * \brief Execute heartbeat functions for a handle + * \param mvply A valid CriMvPly handle + * + * This function executes heartbeat functions for the specified CriMvPly handle only, + * including handoff and parsing of input buffers and audio decoding. Additionally, + * it checks for buffer situations in which the CriMvPly handle should transition to + * one of the four WAIT states of CriMvPlyStatus, and it makes these transitions if + * necessary. + * + * However, video decoding does NOT occur in criMvPly_Execute(). + * + * Expect that criMvPly_Execute() will take a relatively low CPU load. Typically, + * this function should be called on every vertical blank. However, it may be called + * more frequently in a CriMvPly wait state, in conjunction with criMvPly_IncrementState(), + * in order to "force" a transition into the next state without waiting for + * another vertical blank. This type of transition is not generically + * necessary. + * + * \sa CriMvPly, CriMvPlyStatus, criMvPly_ExecuteAll() + */ +void CRIAPI criMvPly_Execute(CriMvPly mvply); + +/* ファイル読み込みバッファの空きチャンク取得 */ +/* + * \brief ファイル読み込みバッファの空きチャンク取得 + * \param mvply : CRI Movie ハンドル + * \param ck : チャンク + * \return なし + * \par 説明: + * ファイル読み込みバッファの空き領域を取得します。
+ * 取得した空き領域(チャンクと呼びます)は、データ書き込みを通知するさいに + * そのまま使用しますので、アプリケーションで記憶してください。
+ * 1度に取得できるチャンクは1つのみです。
+ * チャンクが取得できたか否かは、チャンクのサイズで判定できます。
+ * データの書き込みが終わったら、criMvPly_PutInputChunk関数で書き込みサイズを通知してください。
+ */ +/* + * \ingroup MODULE_SUPPLY + * \brief Get a free chunk from file reading buffer + * \param mvply A valid CriMvPly handle + * \param ck A CriChunk structure to be filled with data by this function + * + * This function selects an empty internal buffer for your data source to read its data into. + * An area of this type is referred to as a "chunk." + * After calling this function, the ck->data and ck->size + * fields will provide a valid pointer and size, respectively, that your data + * source should copy its data into. + * If no buffers can internally be allocated, this function will return 0 as the + * ck->size field. If this occurs, your program should choke input until a free + * buffer can be allocated. + * Typical data sources are native file reading, sequential memory access, or + * playback from a network source. + * The ck->size field is dynamically calculated when criMvPly_AllocateWorkBuffer() + * is called; it is calculated based on expected data rate and video resolutions + * embedded in the stream file. + * + * After you receive a valid chunk from criMvPly_GetInputChunk(), + * you can fill the provided chunk up to the ck->size limit. After you + * fill the chunk with valid data, call the criMvPly_PutInputChunk() function + * to queue the data for processing. The functions criMvPly_GetInputChunk() and + * criMvPly_PutInputChunk() should be called in equal pairs; calling these + * functions out of order will produce odd results. No dynamic chunk reordering + * is permitted; serial calls with out-of-order chunks will be + * flagged at run-time as an error. + * + * This function will only return a valid chunk if the CriMvPly handle is in + * one of two playback states: CRIMVPLY_STATUS_PLAY or CRIMVPLY_STATUS_DECHDR. + * You can verify the current playback state with criMvPly_GetStatus(). + * + * \sa criMvPly_GetStatus(), criMvPly_PutInputChunk(), criMvPly_AllocateWorkBuffer(), + * CriChunk, CriMvPlyStatus + */ +void CRIAPI criMvPly_GetInputChunk(CriMvPly mvply, CriChunk *ck); + +/* ファイル読み込みバッファへのデータ書き込み通知 */ +/* + * \brief ファイル読み込みバッファへのデータ書き込み通知 + * \param mvply : CRI Movie ハンドル + * \param ck : + * \param inputsize : + * \return なし + * \par 説明: + * criMvPly_GetInputChunk関数で取得した空き領域(チャンクと呼びます)に + * データを書き込み終わったら、引数inputsizeにデータサイズを入れて本関数を呼び出してください。
+ * その際、チャンクは criMvPly_GetInputChunk関数で取得したものと同じチャンクを必ず指定してください。 + */ +/* + * \ingroup MODULE_SUPPLY + * \brief Put a data chunk into file read buffer + * \param mvply A valid CriMvPly handle + * \param ck A CriChunk structure containing source data + * \param inputsize The number of bytes actually supplied + * + * This function informs the CriMvPly handle that the CriChunk structure + * now contains valid data from the data source. Typically, you would call + * this function after your asynchronous file read reports that the buffer is + * full of data. + * + * The inputsize field should contain the number of bytes actually provided. + * This value can be less than or equal to ck->size. In an end-of-file condition, + * be sure to supply the actual number of bytes remaining in the file, and not + * merely the size of the input buffer, to criMvPly_PutInputChunk(). + * Do not modify the contents of the CriChunk after calling this function; + * instead, call criMvPly_GetInputChunk() to get a new chunk for further input. + * + * This function invalidates the CriChunk provided if the function is called + * while the CriMvPly handle is in the CRIMVPLY_STATUS_STOP, the + * CRIMVPLY_STATUS_WAIT_PREP, or the CRIMVPLY_STATUS_STOP_PROCESSING state. + * You can verify the current playback state with criMvPly_GetStatus(). + * + * After you receive a valid chunk from criMvPly_GetInputChunk(), + * you can fill the provided chunk up to the ck->size limit. After you call + * fill the chunk with valid data, call the criMvPly_PutInputChunk() function + * to queue the data for processing. The function criMvPly_GetInputChunk() and + * criMvPly_PutInputChunk() should be called in equal pairs; calling these + * functions out of order will produce odd results. No dynamic chunk reordering + * is permitted; serial calls with out-of-order chunks will be + * flagged at run-time as an error. + * + * After putting the final chunk of data in the stream, call + * criMvPly_TerminateSupply() to indicate that an end-of-file condition exists. + * + * \sa criMvPly_GetStatus(), criMvPly_GetInputChunk(), criMvPly_AllocateWorkBuffer(), + * criMvPly_TerminateSupply(), CriChunk, CriMvPlyStatus + */ +void CRIAPI criMvPly_PutInputChunk(CriMvPly mvply, CriChunk *ck, CriUint32 inputsize); + +/* ファイル読み込み終了の通知 */ +/* + * \brief ファイル読み込み終了の通知 + * \param mvply : CRI Movie ハンドル + * \return なし + * \par 説明: + * 再生したい全てのデータを読み込んで、 criMvPly_PutInputChunk関数で通知し終わったら、 + * 本関数でファイル読み込み終了の通知を必ず行ってください。
+ * 終了を通知された時点で読み込みバッファに書き込まれた全てのデータをデコードし終わると、 + * ハンドル状態はWAIT_PLAYENDに遷移します。
+ * 本関数を呼び出さない限り、WAIT_PLAYEND状態になることはありません。 + */ +/* + * \ingroup MODULE_SUPPLY + * \brief Notify end of reading data + * \param mvply A valid CriMvPly structure + * + * After you put all the source data into the CriMvPly handle with + * criMvPly_PutInputChunk(), indicate the end of the movie file by calling + * criMvPly_TerminateSupply(). After calling this function, the CriMvPly + * handle's status is changed by the library to CRIMVPLY_STATUS_WAIT_PLAYEND + * and the library completes processing of whatever frames it has internally + * buffered. + * + * If you do not call this function, the CriMvPly handle will never transition + * to the CRIMVPLY_STATUS_WAIT_PLAYEND state, making teardown impossible. + * + * \sa criMvPly_PutInputChunk(), CriMvPly, CriMvPlyStatus + */ +void CRIAPI criMvPly_TerminateSupply(CriMvPly mvply); + +#if 0//defined(XPT_TGT_EE) +/* RGB32フォーマットのビデオフレームの取得 */ +/* + * \if ps2 + * \brief RGB32フォーマットのビデオフレームの取得 + * \param mvply : CRI Movie ハンドル + * \param imagebuf : ビデオフレームバッファ + * \param bufsize : バッファサイズ + * \param frameinfo : フレーム情報 + * \return 取得できた場合はTRUE, できなかった場合はFALSE + * \par 説明: + * 引数で指定したバッファに、PS2のマクロブロック並びRGBA32フォーマットでフレームを取得します。
+ * 引数CriMvFrameInfo構造体には、取得したフレームについての情報が格納されます。
+ * フレームが取得できるのは、ハンドル状態がWAIT_PLAYING/PLAYINGの時のみです。
+ * それ以外の状態で呼び出す、または入力データ不足の場合には、本関数はフレームの取得に失敗し、即座に復帰します。
+ * フレームが取得できなかった場合は、関数値でFALSEが返ります。
+ * 実際のビデオデコード処理も本関数内で動くため、フレーム取得できる場合には、処理の重い関数となります。 + * \endif + */ +/* + * \if ps2 + * \ingroup MODULE_VIDEO + * \brief Get a video frame in PS2 macroblock RGB32 format + * \param mvply A valid CriMvPly handle + * \param imagebuf a pointer to the video buffer in memory to receive the frame + * \param bufsize video buffer size in bytes + * \param frameinfo Information about the decoded frame + * \return returns true if a frame has been copied into the buffer, false otherwise + * + * This function finds and decodes the current frame, if any, to the imagebuf buffer. + * The format of this buffer is specific to the PS2. This function will only return + * a valid frame if the CriMvPly handle is in the CRIMVPLY_STATUS_WAIT_PLAYING or the + * CRIMVPLY_STATUS_PLAYING state. + * + * This function is an EE-intensive activity, and the amount of time required + * is variable, depending on the complexity and size of the video frame being decoded. + * Therefore the preferred method of calling this function is in a low priority thread, + * separate from your I/O, buffer management, and criMvPly_Execute() routines. + * + * If this function returns true, the preferred display time of the video frame is calculated + * as: + * + * \code + * frameinfo.time / frameinfo.tunit + * \endcode + * + * Humans notice audio stuttering much more readily than a dropped video frame during + * a video decode process. If the frame reported by criMvPly_GetFrameRGBA32_PS2() + * arrives after your system clock says the frame should be displayed, you should + * simply drop the frame without bothering to DMA it to video memory. + * + * Here is an example showing how to drop frames in this case: + * + * \dontinclude crimvt01_simple_playback_ps2.c + * \skip Get video frame + * \until *tutor_update_video_frame_on_display_time* + * + * It is not preferred, but it is possible, to call this function in a single-threaded + * playback model. In this case, it is important to allocate more heap space + * and service the CriMvPly handle with criMvPly_Execute() or criMvPly_ExecuteAll() + * frequently, as well as criMvPly_GetWave16() frequently. This helps to cover + * for the case where other I/O needs to occur when a frame is currently being decoded by + * criMvPly_GetFrameRGBA32_PS2(). + * + * \image html crimvply_getframergba32_ps2.png The DMA reordering step on PS2 + * + * In order to get acceptable performance on the PS2, a macroblock reordering step + * must take place during the DMA transfer from EE RAM to video RAM. + * \endif + */ +CriBool CRIAPI criMvPly_GetFrameRGBA32_PS2(CriMvPly mvply, CriUint8 *imagebuf, CriUint32 bufsize, CriMvFrameInfo *frameinfo); + +CriBool CRIAPI criMvPly_DecodeFrameRGBA32_PS2(CriMvPly mvply, CriUint8 *imagebuf, CriUint32 bufsize, CriMvFrameInfo *frameinfo); +#endif + +#if defined(XPT_TGT_PC) || defined(XPT_TGT_XBOX360) || defined(XPT_TGT_WII) || defined(XPT_TGT_SH7269) || defined(XPT_TGT_TRGP6K) +/* + * \if pc + * \ingroup MODULE_VIDEO + * \brief Get a video frame in YUV422 format + * \param mvply A valid CriMvPly handle + * \param imagebuf A pointer to the video buffer in memory to receive the frame + * \param pitch Number of bytes in one row of the video buffer + * \param bufsize Video buffer size in bytes + * \param frameinfo Information about the decoded frame + * \return returns true if a frame has been copied into the buffer, false otherwise + * + * This function finds and decodes the current frame, if any, to the imagebuf buffer. + * This function will only return a valid frame if the CriMvPly handle is in the + * CRIMVPLY_STATUS_WAIT_PLAYING or the CRIMVPLY_STATUS_PLAYING state. + * + * This function is a CPU-intensive activity, and the amount of time required + * is variable, depending on the complexity and size of the video frame being decoded. + * Therefore the preferred method of calling this function is in a low priority thread, + * separate from your I/O, buffer management, and criMvPly_Execute() routines. + * + * If this function returns true, the preferred display time of the video frame is calculated + * as: + * + * \code + * frameinfo.time / frameinfo.tunit + * \endcode + * + * It is not preferred, but it is possible, to call this function in a single-threaded + * playback model. In this case, it is important to allocate more heap space + * and service the CriMvPly handle with criMvPly_Execute() or criMvPly_ExecuteAll() + * frequently, as well as criMvPly_GetWave16() frequently. + * + * \endif + */ +CriBool CRIAPI criMvPly_GetFrameYUV422(CriMvPly mvply, CriUint8 *imagebuf, CriUint32 pitch, CriUint32 bufsize, CriMvFrameInfo *frameinfo); +#endif + +/* 16bit WAVEフォーマットのオーディオデータ取得 */ +/* + * \brief 16bit WAVEフォーマットのオーディオデータ取得 + * \param mvply : CRI Movie ハンドル + * \param nch : チャネル数 + * \param waveptr : オーディオデータバッファ + * \param wavesmpl : 要求サンプル数(<バッファサイズ) + * \param waveinfo : 16bit Waveform 情報 + * \return 取得できたサンプル数 + * \par 説明: + * 16bitのWAVEフォーマットでオーディオデータを取得します。引数waveptrには、nch分のバッファポインタを格納した + * 配列を指定してください。
+ * 引数CriMvWaveInfo構造体には、取得したオーディオデータについての情報が格納されます。
+ * 入力データ不足などで要求されたサンプル数のデコードができない場合もあります。
+ * (未実装機能) 本関数の処理が重くなってでも、なるべく要求された多くのオーディオデータを取得するモード。 + */ +/* + * \ingroup MODULE_AUDIO + * \brief Get 16bit wave audio data + * \param mvply A currently playing CriMvPly handle + * \param nch The number of audio channels to get in this call + * \param waveptr An array of audio data buffers to copy audio data into + * \param wavesmpl The number of requested wave data samples (must be less than buffer size) + * \param waveinfo A structure filled by this function with info about this wave + * \return The number of wave data samples actually copied into the buffer + * + * This function copies currently decoding audio data into your output buffer + * for you to send to the audio output. The output format is a sixteen-bit PCM + * format. The data provided is "current", e.g. you should try to minimize latency. + * while delivering the audio data to the output device. + * + * This function will return an empty audio buffer if the input to the CriMvPly + * handle is starving for data, or if criMvPly_Execute() or criMvPly_ExecuteAll() + * has not been called recently. + * + * Note that this function actually copies data. However, the expected bandwidth + * for moving audio data in memory is minimal -- about 176400 bytes per second for + * a stereo stream, which is typically a fraction of 1% of the bandwidth available + * on modern game systems. + * + * For debugging tips on stuttering, see \ref crim_section_stuttering . + */ +CriUint32 CRIAPI criMvPly_GetWave16(CriMvPly mvply, CriUint32 nch, CriSint16 *waveptr[], + CriUint32 wavesmpl, CriMvWaveInfo *waveinfo); +CriUint32 CRIAPI criMvPly_GetWave32(CriMvPly mvply, CriUint32 nch, CriFloat32 *waveptr[], + CriUint32 wavesmpl, CriMvWaveInfo *waveinfo); + + +#if defined(XPT_TGT_EE) +/* スクラッチパッドRAM使用設定 */ +/* スクラッチパッドRAMの使用設定(ハンドル作成前に呼び出すこと) */ +/* + * \brief スクラッチパッドRAM使用設定 + * \param sw : + * \return なし + * \par 説明: + * スクラッチパッドRAMの使用設定を行います。
+ * デフォルトはOFFです。 + */ +/* + * \if ps2 + * \ingroup MODULE_INIT + * \brief Enable or disable PS2 scratch pad (SPRAM) usage + * \param sw : ON to enable scratch pad use, OFF to disable + * + * This function determines whether the video decode step uses the PS2 + * SPRAM memory area for its work. The performance of this library is + * increased by around 30% when using SPRAM; however, this use might + * conflict with graphics engines that depend on exclusive access to SPRAM. + * However, on the PS2, the video decode step occurs synchronously to the + * criMvPly_GetFrameRGBA32_PS2() function, so you can take appropriate external + * locking measures to intelligently synchronize SPRAM utilization. + * The value set by criMvPly_SetUseScratchPadRAM_PS2() is internally checked + * exactly once, during the criMvPly_Create() step; calling this function + * after criMvPly_Create() has no effect. The default setting for this + * function is OFF. + * \endif + */ +void CRIAPI criMvPly_SetUseScratchPadRAM_PS2(CriBool sw); +#endif + + +/* メモリからの再生開始 */ +/* + * \brief メモリからの再生開始 + * \param mvply : CRI Movie ハンドル + * \param memptr : メモリ上のムービデータの先頭アドレス + * \param memsize : メモリ上のムービデータのサイズ + * \return なし + * \par 説明: + * メモリからのムービ再生を開始します。
+ * 本関数の呼び出し前に、あらかじめムービデータの全てをメモリ上に読み込んでおいてください。 + */ +/* + * \ingroup MODULE_STATE + * \brief Start playback from movie file on memory + * \param mvply A currently playing CriMvPly handle + * \param memptr A address of movie file + * \param memsize The size of movie file + * + * Start playback from memory.
+ * Please read movie file to memory before playback. + */ +void CRIAPI criMvPly_StartMemory(CriMvPly mvply, CriUint8* memptr, CriUint32 memsize); + + +/* + * YUV個別バッファへのフレーム取得 + */ +/* + * \if xbox360 + * \ingroup MODULE_VIDEO + * \brief Get a video frame to Y,U,V independently texture buffers + * \param mvply A valid CriMvPly handle + * \param yuvbuffers Information about Y,U,V independently texture buffers + * \param frameinfo Information about the decoded frame + * \return returns true if a frame has been copied into the buffer, false otherwise + * + * This function finds and decodes the current frame, if any, to the Y,U,V texture buffers. + * This function will only return a valid frame if the CriMvPly handle is in the + * CRIMVPLY_STATUS_WAIT_PLAYING or the CRIMVPLY_STATUS_PLAYING state. + * \endif + */ +CriBool CRIAPI criMvPly_GetFrameYUVBuffers(CriMvPly mvply, CriMvYuvBuffers *yuvbuffers, CriMvFrameInfo *frameinfo); + + +/* + * ビデオのデコード + */ +/* + * \ingroup MODULE_VIDEO + * \param mvply The movie player handle + * \return returns the number of decoded frames + * + */ +CriUint32 CRIAPI criMvPly_DecodeVideo(CriMvPly mvply); + +/* + * ヘッダのデコード + */ +/* + * + * \ingroup MODULE_VIDEO + * \param mvply The movie player handle + * + */ +void CRIAPI criMvPly_DecodeHeader(CriMvPly mvply); + +/* + * デコードスキップ指示 + * \par 説明: + * この関数を実行した回数だけ、その後のデコード時に自動的に1枚Bピクチャをスキップする。
+ * スキップ指示を出した次のフレームからは、実際のスキップが実行されていなくても + * 表示時刻はスキップしたものとして補正される。 + */ +/* + * \ingroup MODULE_VIDEO + * \param mvply The movie player handle + * \return returns the number of decoded frames + * + * After calling SkipFrame function, Decoding function skip B-picture. + * To avoid that application judge continuous wrong skip, After calling + * SkipFrame function, next frame time will be adjusted. + */ +void CRIAPI criMvPly_SkipFrame(CriMvPly mvply); + + +#if 0 +/* + * YUVA8フォーマットのフレーム取得 + */ +/* + * \if ps3 + * \ingroup MODULE_VIDEO + * \brief Get a video frame in YUVA8 format. + * \param mvply A valid CriMvPly handle + * \param imagebuf A pointer to the video buffer in memory to receive the frame + * \param pitch Number of bytes in one row of the video buffer + * \param bufsize Video buffer size in bytes + * \param frameinfo Information about the decoded frame + * \return returns true if a frame has been copied into the buffer, false otherwise + * + * This function finds and decodes the current frame, if any, to the imagebuf buffer. + * This function will only return a valid frame if the CriMvPly handle is in the + * CRIMVPLY_STATUS_WAIT_PLAYING or the CRIMVPLY_STATUS_PLAYING state. + * \endif + */ +CriBool CRIAPI criMvPly_GetFrameYUVA8_PS3(CriMvPly mvply, CriUint8 *imagebuf, CriUint32 pitch, CriUint32 bufsize, CriMvFrameInfo *frameinfo); +#endif + +/* + * ARGB8888フォーマットでフレーム取得 + */ +/* + * \if ps3 + * \ingroup MODULE_VIDEO + * \brief Get a video frame in ARGB8888 format. + * \param mvply A valid CriMvPly handle + * \param imagebuf A pointer to the video buffer in memory to receive the frame + * \param pitch Number of bytes in one row of the video buffer + * \param bufsize Video buffer size in bytes + * \param frameinfo Information about the decoded frame + * \return returns true if a frame has been copied into the buffer, false otherwise + * + * This function finds and decodes the current frame, if any, to the imagebuf buffer. + * This function will only return a valid frame if the CriMvPly handle is in the + * CRIMVPLY_STATUS_WAIT_PLAYING or the CRIMVPLY_STATUS_PLAYING state. + * \endif + */ +CriBool CRIAPI criMvPly_GetFrameARGB8888(CriMvPly mvply, CriUint8 *imagebuf, CriUint32 pitch, CriUint32 bufsize, CriMvFrameInfo *frameinfo); +void CRIAPI criMvPly_InitializeFrameARGB8888(void); + + +#if defined(XPT_TGT_IPHONE) || defined(XPT_TGT_WINMO) || defined(XPT_TGT_ANDROID) || defined(XPT_TGT_CQSH2A) || defined(XPT_TGT_ACRODEA) || defined(XPT_TGT_NACL) || defined(XPT_TGT_SH7269) || defined(XPT_TGT_TRGP6K) +/* + * RGB565フォーマットでフレーム取得 + */ +/* + * \ingroup MODULE_VIDEO + * \brief Get a video frame in RGB565 format + */ +CriBool CRIAPI criMvPly_GetFrameRGB565(CriMvPly mvply, CriUint8 *imagebuf, CriUint32 pitch, CriUint32 bufsize, CriMvFrameInfo *frameinfo); +void CRIAPI criMvPly_InitializeFrameRGB565(void); +#endif + +/* + * 次のフレームの情報だけ取得する + */ +/* + * \ingroup MODULE_VIDEO + * \brief Get a information of next video frame (without actual video frame). + */ +CriUint8* CRIAPI criMvPly_GetNextFrameInfo(CriMvPly mvply, CriMvFrameInfo *frameinfo); + +/* + * 次のフレームを捨てる + */ +CriBool CRIAPI criMvPly_DiscardNextFrame(CriMvPly mvply, CriMvFrameInfo *frameinfo); + +/* + * 再生準備完了状態(PREPからWAIT_PLAYING)になるまでに貯金するフレーム数の指定 + * この関数を呼び出さなければ、貯金フレーム数 = フレームプール数 + */ +void CRIAPI criMvPly_SetNumberOfFramesForPrep(CriMvPly mvply, CriSint32 nframes); + +/* + * For Debug use. + */ +void CRIAPI criMvPly_SetSeekPosition(CriMvPly mvply, CriSint32 seek_frame_id, CriSint32 video_gop_top_id); +void CRIAPI criMvPly_SetSeekAlphaPosition(CriMvPly mvply, CriSint32 alpha_gop_top_id); +void CRIAPI criMvPly_CalcSeekPosition(CriMvPly mvply, void *seektbl_ptr, CriUint32 seektbl_size, Sint32 frame_id, Uint64 *offset, Sint32 *gop_top_id); + +/* for specific use */ +/* ボディアドレスの設定 */ +void CRIAPI criMvPly_SetBodyData(CriMvPly mvply, const CriUint64Adr body_ptr, CriSint64 body_size); + +/* 入力SJおよびバッファサイズの取得(バッファサイズ、リロードサイズはNULL指定で省略) */ +CriSj CRIAPI criMvPly_GetInputSj(CriMvPly mvply, CriUint32 *buffer_size, CriUint32 *reload_threshold); + +/* 名前&タイプ指定によるイベントポイント情報の取得 */ +//Bool criMvPly_SearchEventPointByName(CriMvPly mvply, Char8 *cue_name, Sint32 type, CriMvEventPoint *eventinfo); +/* イベントポイント情報からフレームIDへの変換 */ +//Sint32 criMvPly_CalcFrameIdFromCuePoint(CriMvPly mvply, CriMvEventPoint *eventinfo); + +CriBool CRIAPI criMvPly_AttachSubAudio(CriMvPly mvply, CriHeap heap, CriUint32 track); +CriUint32 CRIAPI criMvPly_GetSubAudioWave16(CriMvPly mvply, CriUint32 nch, CriSint16 *waveptr[], CriUint32 wavesmpl, CriMvWaveInfo *waveinfo); +CriUint32 CRIAPI criMvPly_GetSubAudioWave32(CriMvPly mvply, CriUint32 nch, CriFloat32 *waveptr[], CriUint32 wavesmpl, CriMvWaveInfo *waveinfo); +void CRIAPI criMvPly_DetachSubAudio(CriMvPly mvply); + +void CRIAPI criMvPly_GetSubtitle(CriMvPly mvply, CriUint8 *bufptr, CriUint32 bufsize, CriMvSubtitleInfo *info); +void CRIAPI criMvPly_GetNextSubtitleInfo(CriMvPly mvply, CriMvSubtitleInfo *info); + +/* 入力バッファのデータ量を見る[byte] */ +CriUint32 CRIAPI criMvPly_PeekInputBufferData(CriMvPly mvply); +/* メモリ上のムービを入力SJに追加する */ +void CRIAPI criMvPly_AddInputMemory(CriMvPly mvply, CriUint8* memptr, CriUint32 memsize); + + +/* 取得できるオーディオデータのサンプル数を調べる */ +CriUint32 CRIAPI criMvPly_GetDataSizeMainAudio(CriMvPly mvply, CriUint32 nch); +/* 取得できるオーディオデータのサンプル数を調べる */ +CriUint32 CRIAPI criMvPly_GetDataSizeSubAudio(CriMvPly mvply, CriUint32 nch); + +/* メインのオーディオの再生が終了しているかどうかを調べる */ +CriBool CRIAPI criMvPly_IsEndMainAudioPlayback(CriMvPly mvply); +/* サブのオーディオの再生が終了しているかどうかを調べる */ +CriBool CRIAPI criMvPly_IsEndSubAudioPlayback(CriMvPly mvply); + +/* メインオーディオが活動中かどうかを調べる (デコード中かつ出力バッファがある状態) */ +CriBool CRIAPI criMvPly_IsActiveMainAudioPlayback(CriMvPly mvply); + +/* ワーク確保前に設定変更すること */ +void CRIAPI criMvPly_SetPcmFormat(CriMvPly mvply, CriMvPcmFormat pcmfmt); + +#if defined(XPT_TGT_PC) +/* [PC] マルチプロセッサの指定 */ +//void CRIAPI criMvPly_SetProcessorParameters_PC(CriMvPly mvply, Sint32 thread_num, Uint32 *affinity_masks, Sint32 *priorities); +#endif + +#if defined(XPT_TGT_XBOX360) +/* [Xbox360] マルチプロセッサの指定 */ +void CRIAPI criMvPly_SetProcessorParameters_XBOX360(CriMvPly mvply, Sint32 thread_num, CriUint32 processor_mask, CriSint32 *priorities); +#endif + +#if defined(XPT_TGT_PS3PPU) +/* [PS3] SPURSの指定 */ +void CRIAPI criMvPly_SetupSpursParameters_PS3(const CriMvProcessorParameters_PS3 *processor_param); + /* [PS3] SPUスレッドによるマルチプロセッサの指定 */ +void CRIAPI criMvPly_SetupSpuThreadParameters_PS3(const CriMvSpuThreadParameters_PS3 *spu_thread_param); +void CRIAPI criMvPly_SetGraphicEnv(CriMvGraphicEnv env); +CriMvGraphicEnv CRIAPI criMvPly_GetGraphicEnv(void); +#endif + +/* フレームプール情報の取得 */ +void CRIAPI criMvPly_GetFramePoolInfo(CriMvPly mvply, CriSint32 *num_input, CriUint32* num_data, CriUint32* num_ref, CriUint32* num_hold, CriUint32* num_free); + +/* 再生中でも字幕チャネルを切り替える */ +void CRIAPI criMvPly_SetSubtitleChannel(CriMvPly mvply, CriSint32 chno); + +/* ポインタだけ取得してフレームプール内のバッファをロックする */ +CriBool CRIAPI criMvPly_LockFrameBuffer(CriMvPly mvply, CriMvYuvBuffers *yuvbuffers, CriMvFrameInfo *frameinfo); +/* ロックしていたフレームプールを解放する */ +CriBool CRIAPI criMvPly_UnlockFrameBuffer(CriMvPly mvply, CriMvFrameInfo *frameinfo); + +/* + * For Sofdec2 + */ +CriMvPly CRIAPI criMvPly_CreateWithWork(void *work, CriSint32 size, CriMvHandleConfig *config); +CriSint32 CRIAPI criMvPly_CalcHandleWorkSize(CriMvHandleConfig *config); +CriSint32 CRIAPI criMvPly_CalcPlaybackWorkSize(CriMvPly mvply, CriMvStreamingParameters *stmprm); +CriBool CRIAPI criMvPly_AllocateWorkBufferWithWork(CriMvPly mvply, void *work ,Sint32 work_size, CriMvStreamingParameters *stmprm); +void CRIAPI criMvPly_SetMetaDataWorkAllocator(CriMvPly mvply, CriMvMetaDataWorkMallocFunc allocfunc, CriMvMetaDataWorkFreeFunc freefunc, void *usrobj, CriMvMetaFlag meta_flag); +CriSint32 criMvPly_CalcSubAudioWorkSize(CriMvPly mvply, const CriMvAudioParameters *aprm); +CriBool criMvPly_CopyFrameYUVBuffers(CriMvPly mvply, CriMvYuvBuffers *yuvbuffers, + const CriMvFrameInfo *frameinfo,const CriMvAlphaFrameInfo *alpha_frameinfo); +CriBool criMvPly_CopyFrameARGB8888Buffer(CriMvPly mvply, CriUint8 *dst_buf, CriUint32 dst_pitch, CriUint32 dst_bufsize, + const CriMvYuvBuffers *src_bufs, const CriMvFrameInfo *src_vinf, const CriMvAlphaFrameInfo *src_ainf); +#if defined(XPT_TGT_IPHONE) || defined(XPT_TGT_WINMO) || defined(XPT_TGT_ANDROID) || defined(XPT_TGT_CQSH2A) || defined(XPT_TGT_ACRODEA) || defined(XPT_TGT_NACL) || defined(XPT_TGT_SH7269) || defined(XPT_TGT_TRGP6K) || defined(XPT_TGT_TRGP6K) +CriBool criMvPly_CopyFrameRGB565Buffer(CriMvPly mvply, CriUint8 *dst_buf, CriUint32 dst_pitch, CriUint32 dst_bufsize, + const CriMvYuvBuffers *src_bufs, const CriMvFrameInfo *src_vinf, const CriMvAlphaFrameInfo *src_ainf); +#endif +CriBool criMvPly_LockAlphaFrameBuffer(CriMvPly mvply, CriMvYuvBuffers *yuvbuffers, CriMvAlphaFrameInfo *alpha_frameinfo); +CriBool criMvPly_UnlockAlphaFrameBuffer(CriMvPly mvply, CriMvAlphaFrameInfo *alpha_frameinfo); +CriSint32 criMvPly_GetNumPictureData(CriMvPly mvply); +const CriMvPlyHeaderInfo* criMvPly_GetCurrentStreamInfo(CriMvPly mvply); +/* for debug */ +CriBool CRIAPI criMvPly_GetAlphaFrame(CriMvPly mvply, CriUint8 *imagebuf, CriUint32 pitch, CriMvAlphaFrameInfo *alpha_frameinfo); + +/* OUTER_FRAMEPOOL_WORK */ +/* フレームプール用ワーク計算。ハンドルはNULL指定OK。 */ +CriSint32 criMvPly_CalcFramepoolWorkSize(CriMvPly mvply, const CriMvStreamingParameters *stmprm); +/* フレームプール用ワーク設定 */ +void criMvPly_SetFramepoolWork(CriMvPly mvply, void *work, CriSint32 work_size); +/* フレームプール用ワークアロケータ設定 */ +void criMvPly_SetFramepoolWorkAllocator(CriMvPly mvply, CriMvFramepoolWorkMallocFunc allocfunc, CriMvFramepoolWorkFreeFunc freefunc, void *usrobj); + +/* シークブロック情報の取得 */ +/* <入力> + * - seektbl_ptr : UTFアドレス + * - seektbl_size : UTFサイズ + * - num_seekblock : 出力配列の要素数 + * <出力> + * - blockinfo : シークブロック情報配列へのポインタ(num_seekblock分の領域を確保して渡すこと) + */ +void criMvPly_GetSeekBlockInfo(CriMvPly mvply, void *seektbl_ptr, CriUint32 seektbl_size, CriSint32 num_seekblock, CriMvSeekBlockInfo *blockinfo); + +/* フレームレートの強制指定 */ +void criMvPly_SetVideoFramerate(CriMvPly mvply, CriUint32 framerate_n, CriUint32 framerate_d); + +/* 同期有無の設定 */ +void criMvPly_SetSyncFlag(CriMvPly mvply, CriBool sync_flag); + +/* 再生可能かの問い合わせ */ +CriBool criMvPly_IsPlayable(CriMvPly mvply, const CriMvStreamingParameters *stmprm); + + + +#ifdef __cplusplus +} +#endif + +#endif /* CRI_MOVIE_CORE_H_INCLUDED */ diff --git a/3rdParty/cri/PS4/include/cri_movie_ps4.h b/3rdParty/cri/PS4/include/cri_movie_ps4.h new file mode 100644 index 00000000..95e804e6 --- /dev/null +++ b/3rdParty/cri/PS4/include/cri_movie_ps4.h @@ -0,0 +1,94 @@ +/**************************************************************************** + * + * CRI Middleware SDK + * + * Copyright (c) 2013 CRI Middleware Co., Ltd. + * + * Library : CRI Movie + * Module : Library User's Header + * File : cri_movie_ps4.h + * Date : 2013-11-25 + * + ****************************************************************************/ +/*! + * \file cri_movie_ps4.h + */ +#ifndef CRI_MOVIE_PS4_H_INCLUDED /* Re-definition prevention */ +#define CRI_MOVIE_PS4_H_INCLUDED + +/*************************************************************************** + * Include file + ***************************************************************************/ +#include + +#include +#include + +/*************************************************************************** + * Variable Declaration + ***************************************************************************/ +namespace CriMv { + extern CriError ErrorContainer; +} + +/*************************************************************************** + * Prototype Functions + ***************************************************************************/ +namespace CriMv { + /*EN + * \ingroup MODULE_OPTION + * \brief Set processor parameters for decoding (Library Global) + * + * \param num_threads Number of additional threads for load distribution in decoding (Maximum 5 threads) + * \param affinity_mask Pointer to an array of thread affinity masks for each thread specified with num_threads. + * \param priorities Pointer to an array of thread priority for each thread specified with num_threads. + * \param err Optional error code + * + * This function sets the processor parameters for decoding as default setting of library global. + * Use it when you want to change processors or thread priority for decoding load distribution. + * + * If this function is called, it must be called before library initialization. + * + * On initialization, CRI Movie prepares 5 worker threads for distributed decoding.
+ * + * \a num_threads specifies how many worker threads CRI Movie should use.
+ * \a affinity_mask is an array of affinity masks for the worker threads. This array must have + * \a num_threads many elements. + * \a priorities is an array of thread priority for the worker threads. This array must have + * \a num_threads many elements. + * The format of \a affinity_mask and \a priorities is same as for the value passed to the OS standard API.
+ * + * If this function is not called, 5 distributed decoding threads will run in parallel by default. + * Also, processor assignment of the decoding threads is handled by the operating system, and their + * priority will be 725 (below main thread). + */ + /*JP + * \ingroup MODULE_OPTION + * \brief デコード処理に使う追加プロセッサ設定(ライブラリ全体) + * \param num_threads 負荷分散デコード用に使用する追加スレッドの数 (最大5つ) + * \param affinity_masks スレッドアフィニティマスクの配列へのポインタ。num_threadsで指定したスレッドごとのマスク値。 + * \param priorities 追加スレッドの優先度配列へのポインタ。 + * \param err エラー情報(省略可) + * + * デコード処理を分散して処理するためのプロセッサをライブラリ全体に指定します。 + * デコード処理に行うプロセッサやスレッド優先度を変更したい場合に使用してください。 + * 本関数はライブラリ初期化前に呼び出す必要があります。 + * + * CRI Movieは初期化の際に5つの分散デコード用のワーカースレッドを用意します。 + * num_threads引数で、そのうちのいくつのスレッドを実際に使用するかを指定できます。 + * アプリケーションから明示的にプロセッサ割り当てを行いたい場合、個々のスレッドに対して + * アフィニティマスクとスレッド優先度を設定してください。 + * アフィニティマスクとスレッド優先度の値は、OS標準関数の引数と同じ書式です。 + * + * この関数を呼ばなかった場合、5つのスレッドで並列デコードを行います。 + * デコードスレッドのプロセッサは割り当ては全てOS任せで、優先度は725(メインスレッドより下)になります。 + */ + void SetUsableProcessors_PS4( + CriSint32 num_threads, + const SceKernelCpumask *affinity_masks, + const int *priorities, + CriError &err = CriMv::ErrorContainer); +} + + +#endif /* CRI_MOVIE_PS4_H_INCLUDED */ diff --git a/3rdParty/cri/PS4/include/cri_sj.h b/3rdParty/cri/PS4/include/cri_sj.h new file mode 100644 index 00000000..28b29424 --- /dev/null +++ b/3rdParty/cri/PS4/include/cri_sj.h @@ -0,0 +1,189 @@ +/**************************************************************************** + * + * CRI Middleware SDK + * + * Copyright (c) 2006-2010 CRI Middleware Co., Ltd. + * + ****************************************************************************/ + +#ifndef _CRI_SJ_H_INCLUDED +#define _CRI_SJ_H_INCLUDED +/**************************************************************************** + * * + * CRI Stream Joint "CriSj" Library * + * * + * 2005-06-21 written by M.Oshimi * + * * + ****************************************************************************/ + +/**************************************************************************** + * Include file * + ****************************************************************************/ +#include "cri_xpt.h" +#include "cri_heap.h" + +/**************************************************************************** + * MACRO CONSTANT * + ****************************************************************************/ + +/* Version number of CriSj */ +#define CRISJ_NAME_STRINGS "CRI Stream Joint" +#define CRISJ_VERSION_STRINGS "1.01.00" + +#define CRISJUNI_MAX_LINE (4) +#define CRICHUNK_MAX_SIZE (0xffffffff) + +/*********************************************************************** + * Process MACRO + ***********************************************************************/ + +/**************************************************************************** + * Data type declaration * + ****************************************************************************/ + +/* ストリームライン */ +typedef enum { + CRISJ_LINE_FREE = (0), + CRISJ_LINE_DATA = (1), + CRISJ_LINE_HOLD = (2), + CRISJ_LINE_EXTRA = (3), + /* enum be 4bytes */ + CRISJ_LINE_ENUM_BE_SINT32 = 0x7FFFFFFF +} CriSjLine; + +/* チャンク */ +#ifndef TYPEDEF_CRICHUNK +#define TYPEDEF_CRICHUNK +typedef struct { + CriUint8 *data; /* データ */ + CriUint32 size; /* バイト数 */ +} CriChunk; +#endif + +/* CriSjハンドル */ +/* CriSj handle */ +typedef struct { + struct _crisj_function_table *vtbl; + const CriChar8 *name; +} CriSjObj, *CriSj; + +typedef struct _crisj_function_table { + /* ハンドルの消去 */ + void (*Destroy)(CriSj sj); + /* リセット */ + void (*Reset)(CriSj sj); + /* チャンクの取得 (FIFOの先頭から取得) */ + void (*GetChunk)(CriSj sj, CriSjLine id, CriUint32 nbyte, CriChunk *ck); + /* チャンクを戻す (FIFOの先頭に挿入) */ + void (*UngetChunk)(CriSj sj, CriSjLine id, CriChunk *ck); + /* チャンクを挿入 (FIFOの最後に挿入) */ + void (*PutChunk)(CriSj sj, CriSjLine id, CriChunk *ck); + /* ラインから取得できる総バイト数の取得 */ + CriUint32 (*GetTotalSize)(CriSj sj, CriSjLine id); +} CriSjVirtualFunctionTable; + +typedef enum { + CRISJ_UNIMODE_SEPARATE = (0), + CRISJ_UNIMODE_JOIN = (1), + /* enum be 4bytes */ + CRISJ_UNIMODE_ENUM_BE_SINT32 = 0x7FFFFFFF +} CriSjUniversalMode; + + +typedef struct CriSjRbfConfig { + CriBool use_cs; + CriUint32 buffer_size; + CriUint32 extra_size; + CriUint32 alignment; + const CriChar8 *buffer_name; +} CriSjRbfConfig; + +typedef struct CriSjMemConfig { + CriBool use_cs; + CriUint8 *data; + CriUint32 data_size; +} CriSjMemConfig; + +typedef struct CriSjUniConfig { + CriBool use_cs; + CriSjUniversalMode mode; + CriUint32 num_chunks; +} CriSjUniConfig; + +/**************************************************************************** + * Function Declaration * + ****************************************************************************/ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +/* リングバッファ型SJの作成 */ +CriSint32 CRIAPI criSjRbf_CalculateWorkSize(const CriSjRbfConfig* config); +CriSj CRIAPI criSjRbf_Create(const CriSjRbfConfig *config, void *work, CriSint32 work_size); +CriSj CRIAPI criSjRbf_CreateByHeap(const CriSjRbfConfig *config, CriHeap heap, CriHeapType heap_type); + +/* 常駐メモリ型SJの作成 */ +CriSint32 CRIAPI criSjMem_CalculateWorkSize(const CriSjMemConfig* config); +CriSj CRIAPI criSjMem_Create(const CriSjMemConfig *config, void *work, CriSint32 work_size); +CriSj CRIAPI criSjMem_CreateByHeap(const CriSjMemConfig *config, CriHeap heap, CriHeapType heap_type); + +/* ユニバーサルSJの作成 */ +CriSint32 CRIAPI criSjUni_CalculateWorkSize(const CriSjUniConfig* config); +CriSj CRIAPI criSjUni_Create(const CriSjUniConfig *config, void *work, CriSint32 work_size); +CriSj CRIAPI criSjUni_CreateByHeap(const CriSjUniConfig *config, CriHeap heap, CriHeapType heap_type); +/* チェインプール数の取得 */ +CriSint32 CRIAPI criSjUni_GetNumChainPool(CriSj sj); + +void CRIAPI criSj_Destroy(CriSj sj); +void CRIAPI criSj_Reset(CriSj sj); +void CRIAPI criSj_GetChunk(CriSj sj, CriSjLine line, CriUint32 nbyte, CriChunk *ck); +void CRIAPI criSj_UngetChunk(CriSj sj, CriSjLine line, CriChunk *ck); +void CRIAPI criSj_PutChunk(CriSj sj, CriSjLine line, CriChunk *ck); +CriUint32 CRIAPI criSj_GetTotalSize(CriSj sj, CriSjLine line); +void CRIAPI criSj_SplitChunk(CriChunk *ck, CriUint32 nbyte, CriChunk *ck1, CriChunk *ck2); + +/*** +* New APIs +***/ + +CriUint32 CRIAPI criSj_GetInputFreeSize(CriSj sj); +void CRIAPI criSj_GetInputChunk(CriSj sj, CriChunk *ck); +void CRIAPI criSj_PutInputChunk(CriSj sj, CriChunk *ck, CriUint32 input_size); +CriUint32 CRIAPI criSj_GetOutputDataSize(CriSj sj); +void CRIAPI criSj_GetOutputChunk(CriSj sj, CriChunk *ck); +void CRIAPI criSj_PutOutputChunk(CriSj sj, CriChunk *ck, CriUint32 output_size); + +CriUint32 CRIAPI criSj_PutOutputChunk2(CriSj sj, CriChunk *ck1, CriChunk *ck2, CriUint32 output_size); + + +/*** +* Old Interface (for compatibility) +***/ +typedef struct _CriSjConfig { + CriBool use_cs; + CriHeapType heap_type; +} CriSjConfig; + +CriSj CRIAPI criSj_CreateRingBuffer(CriHeap heap, CriUint32 bsize, CriUint32 xsize, CriUint32 align); +CriSj CRIAPI criSj_CreateNamedRingBuffer(CriHeap heap, CriUint32 bsize, CriUint32 xsize, CriUint32 align, const CriChar8 *bname); +CriSj CRIAPI criSj_CreateRingBufferWithConfig(CriHeap heap, CriUint32 bsize, CriUint32 xsize, CriUint32 align, const CriSjConfig *config); +CriSj CRIAPI criSj_CreateNamedRingBufferWithConfig(CriHeap heap, CriUint32 bsize, CriUint32 xsize, CriUint32 align, const CriChar8 *bname, const CriSjConfig *config); +CriSint32 CRIAPI criSjRbf_GetRequiredMemorySizeWithConfig(CriUint32 bsize, CriUint32 xsize, CriUint32 align, const CriSjConfig *config); + +CriSj CRIAPI criSj_CreateMemory(CriHeap heap, CriUint8 *data, CriUint32 dtsize, CriUint32 align); +CriSj CRIAPI criSj_CreateMemoryWithConfig(CriHeap heap, CriUint8 *data, CriUint32 dtsize, CriUint32 align, const CriSjConfig *config); +CriSint32 CRIAPI criSjMem_GetRequiredMemorySizeWithConfig(CriUint32 align, const CriSjConfig *config); + +CriSj CRIAPI criSj_CreateUniversal(CriHeap heap, CriSjUniversalMode mode, CriUint32 nchunk); +CriSj CRIAPI criSj_CreateUniversalWithConfig(CriHeap heap, CriSjUniversalMode mode, CriUint32 nchunk, const CriSjConfig *config); +CriSint32 CRIAPI criSjUni_GetRequiredMemorySizeWithConfig(CriSjUniversalMode mode, CriUint32 nchunk, const CriSjConfig *config); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + + +#endif + +/* end of file */ diff --git a/3rdParty/cri/PS4/include/cri_xpt.h b/3rdParty/cri/PS4/include/cri_xpt.h new file mode 100644 index 00000000..57fafec1 --- /dev/null +++ b/3rdParty/cri/PS4/include/cri_xpt.h @@ -0,0 +1,27 @@ +/**************************************************************************** + * + * CRI Middleware SDK + * + * Copyright (c) 2012 CRI Middleware Co., Ltd. + * + * Library : CRI Middleware Library + * Module : CRI Common Header for PS4 + * File : cri_xpt.h + * Date : 2012-10-04 + * Version : 1.00 + * + ****************************************************************************/ +#ifndef CRI_INCL_CRI_XPT_H +#define CRI_INCL_CRI_XPT_H + +#define XPT_TGT_PS4 +#define XPT_CCS_LEND +#define XPT_DISABLE_FSV1API +#define CRI_TARGET_STR "PS4" + + +#include "cri_xpts_ps4.h" +#include "cri_xpt_post.h" + +#endif /* CRI_INCL_CRI_XPT_H */ +/* End Of File */ diff --git a/3rdParty/cri/PS4/include/cri_xpt_post.h b/3rdParty/cri/PS4/include/cri_xpt_post.h new file mode 100644 index 00000000..7cc8341a --- /dev/null +++ b/3rdParty/cri/PS4/include/cri_xpt_post.h @@ -0,0 +1,256 @@ +/***************************************************************************** + * + * CRI Middleware SDK + * + * Copyright (c) 1998-2012 CRI Middleware Co., Ltd. + * + * Library : CRI Middleware Library + * Module : CRI Common Header / Post-Process + * File : cri_xpt_post.h + * Date : 2012-05-15 + * Version : 2.07 + * + *****************************************************************************/ +#ifndef CRI_INCL_CRI_XPT_POST_H +#define CRI_INCL_CRI_XPT_POST_H + + +/***************************************************************************** + * マクロ定義 + * Macro definition + *****************************************************************************/ + +/* コンパイル時の静的アサート + * C++ BoostのSTATIC_ASSERTと同等の機能をC言語で実装する。 + * 条件が真であることを検証する。偽の場合はコンパイルエラーを起こして、コン + * パイルを停止させる。 + * Static Asart when compiling + * This function is equal to STATIC_ASSERT of C++ Boost, and is imprementated + * by C language. If the condition is false, a compiler error is caused and + * it stop compiling. + */ +#define XPT_STATIC_ASSERT(cond) extern int xpt_static_assert_array[(cond)?1:-1] + + +/***************************************************************************** + * コンパイルオプションの検証 + * Compiler option test + *****************************************************************************/ + +/* enum型の検証 + *  enum型がint型に整合することを検証する。 + *  適切なエラーメッセージを表示したいので、可能ならコンパイルオプションによる + *  チェックを行う。不可能な場合、汎用的な静的アサートによるチェックが働く。 + * Enum type test + * It is verified that the enum type adjusts to the int type. + * To display an appropriate error message, it checks the compiler option + * if possible. General static asart test works if it is impossible. + */ +#if defined(__MWERKS__) /* CodeWarrior */ + //#if !__option(enumsalwaysint) + // #error ERROR cri_xpt_post.h : Compiler option 'Enums Always Int' should be ON. + //#endif +#elif defined(__GNUC__) + //#if Compiler option -fshort-enums is used + // #error ERROR cri_xpt_post.h : Compiler option '-fshort-enums' should not be used. + //#endif +#endif +//typedef enum {XPT_TEST_ENUM_0, XPT_TEST_ENUM_1, XPT_TEST_ENUM_2} XptTestEnum; +//XPT_STATIC_ASSERT(sizeof(XptTestEnum) == sizeof(Uint32)); /* enum should be 4byte. */ + +/***************************************************************************** + * 定数マクロ + * Macros of constant value + *****************************************************************************/ + +/* NULL ポインタ型 */ +#if !defined(CRI_NULL) +#ifdef __cplusplus +#define CRI_NULL (0) +#else +#define CRI_NULL ((void *)0) +#endif +#endif + +/* 論理定数1(偽、真) */ +#if !defined(CRI_FALSE) +#define CRI_FALSE (0) +#endif +#if !defined(CRI_TRUE) +#define CRI_TRUE (1) +#endif + +/* 論理定数2(スイッチ) */ +#if !defined(CRI_OFF) +#define CRI_OFF (0) +#endif +#if !defined(CRI_ON) +#define CRI_ON (1) +#endif + +/* 結果判定の定数(成功、失敗) */ +#if !defined(CRI_OK) +#define CRI_OK (0) /* 成功 */ +#endif +#if !defined(CRI_NG) +#define CRI_NG (-1) /* 失敗 */ +#endif + +/***************************************************************************** + * ポインタまたは64ビットアドレスを格納できる整数型 + * 備考: ポインタ32bitかつROMアドレス空間64bitの環境で、両者を透過的に扱える。 + * The integer type which can hold an pointer or an address up to 64 bits. + * NOTE: In the environment of pointer 32bit and ROM address space 64bit, + * this type can treat both transparently. + *****************************************************************************/ + +#if !defined(_TYPEDEF_CriUint64Adr) +#define _TYPEDEF_CriUint64Adr +typedef CriUint64 CriUint64Adr; /* ポインタまたは64ビットアドレスを格納できる整数型 */ +#endif + +#if !defined(CRI_PTR_TO_UINT64ADR) +#define CRI_PTR_TO_UINT64ADR(ptr) ((CriUint64Adr)(ptr)) /* Convert pointer to CriUint64Adr */ +#endif + +#if !defined(CRI_UINT64ADR_TO_PTR) +#define CRI_UINT64ADR_TO_PTR(uint64adr) ((void *)(CriUintPtr)(uint64adr)) /* Convert CriUint64Adr to pointer */ +#endif + +#if !defined(CRI_XPT_DISABLE_UNPREFIXED_TYPE) + +/***************************************************************************** + * 互換性維持のための定数マクロ + * Macros for compatibility with old version + *****************************************************************************/ + +/* NULL ポインタ型 */ +#if !defined(NULL) +#define NULL (CRI_NULL) +#endif + +/* 論理定数1(偽、真) */ +#if !defined(FALSE) +#define FALSE (CRI_FALSE) +#endif +#if !defined(TRUE) +#define TRUE (CRI_TRUE) +#endif + +/* 論理定数2(スイッチ) */ +#if !defined(OFF) +#define OFF (CRI_OFF) +#endif +#if !defined(ON) +#define ON (CRI_ON) +#endif + +/* 結果判定の定数(成功、失敗) */ +#if !defined(OK) +#define OK (CRI_OK) +#endif +#if !defined(NG) +#define NG (CRI_NG) +#endif + +/***************************************************************************** + * 互換性維持のためのデータ型宣言 + * Types for compatibility with old version + *****************************************************************************/ + +#if !defined(_TYPEDEF_Uint8) +#define _TYPEDEF_Uint8 +typedef CriUint8 Uint8; /* 符号なし1バイト整数 */ +#endif + +#if !defined(_TYPEDEF_Sint8) +#define _TYPEDEF_Sint8 +typedef CriSint8 Sint8; /* 符号つき1バイト整数 */ +#endif + +#if !defined(_TYPEDEF_Uint16) +#define _TYPEDEF_Uint16 +typedef CriUint16 Uint16; /* 符号なし2バイト整数 */ +#endif + +#if !defined(_TYPEDEF_Sint16) +#define _TYPEDEF_Sint16 +typedef CriSint16 Sint16; /* 符号つき2バイト整数 */ +#endif + +#if !defined(_TYPEDEF_Uint32) +#define _TYPEDEF_Uint32 +typedef CriUint32 Uint32; /* 符号なし4バイト整数 */ +#endif + +#if !defined(_TYPEDEF_Sint32) +#define _TYPEDEF_Sint32 +typedef CriSint32 Sint32; /* 符号つき4バイト整数 */ +#endif + +#if !defined(_TYPEDEF_Uint64) +#define _TYPEDEF_Uint64 +typedef CriUint64 Uint64; /* 符号なし8バイト整数 */ +#endif + +#if !defined(_TYPEDEF_Sint64) +#define _TYPEDEF_Sint64 +typedef CriSint64 Sint64; /* 符号つき8バイト整数 */ +#endif + +#if !defined(_TYPEDEF_Uint128) +#define _TYPEDEF_Uint128 +typedef CriUint128 Uint128; /* 符号なし16バイト整数 */ +#endif + +#if !defined(_TYPEDEF_Sint128) +#define _TYPEDEF_Sint128 +typedef CriSint128 Sint128; /* 符号つき16バイト整数 */ +#endif + +#if !defined(_TYPEDEF_Float16) +#define _TYPEDEF_Float16 +typedef CriFloat16 Float16; /* 2バイト実数 */ +#endif + +#if !defined(_TYPEDEF_Float32) +#define _TYPEDEF_Float32 +typedef CriFloat32 Float32; /* 4バイト実数 */ +#endif + +#if !defined(_TYPEDEF_Float64) +#define _TYPEDEF_Float64 +typedef CriFloat64 Float64; /* 8バイト実数 */ +#endif + +#if !defined(_TYPEDEF_Fixed32) +#define _TYPEDEF_Fixed32 +typedef CriFixed32 Fixed32; /* 固定小数点32ビット */ +#endif + +/* X11 API(xtrapproto.h)との競合回避用 */ +#if !defined(_TYPEDEF_Bool) && !defined(Bool) +#define _TYPEDEF_Bool +typedef CriBool Bool; /* 論理型(論理定数を値にとる) */ +#endif + +#if !defined(_TYPEDEF_Char8) +#define _TYPEDEF_Char8 +typedef CriChar8 Char8; /* 文字型 */ +#endif + +#if !defined(_TYPEDEF_SintPtr) +#define _TYPEDEF_SintPtr +typedef CriSintPtr SintPtr; +#endif + +#if !defined(_TYPEDEF_UintPtr) +#define _TYPEDEF_UintPtr +typedef CriUintPtr UintPtr; +#endif + +#endif /* CRI_XPT_DISABLE_UNPREFIXED_TYPE */ + +#endif /* CRI_INCL_CRI_XPT_POST_H */ + +/* end of file */ diff --git a/3rdParty/cri/PS4/include/cri_xpts_ps4.h b/3rdParty/cri/PS4/include/cri_xpts_ps4.h new file mode 100644 index 00000000..919ae0f6 --- /dev/null +++ b/3rdParty/cri/PS4/include/cri_xpts_ps4.h @@ -0,0 +1,133 @@ +/**************************************************************************** + * + * CRI Middleware SDK + * + * Copyright (c) 1998-2012 CRI Middleware Co., Ltd. + * + * Library : CRI Middleware Library + * Module : CRI Common Header for PS4 + * File : cri_xpts_ps4.h + * Date : 2012-10-04 + * Version : 2.01 + * + ****************************************************************************/ + +#if !defined(CRI_INCL_CRI_XPTS_PS4_H) +#define CRI_INCL_CRI_XPTS_PS4_H + +/***************************************************************************** + * 基本データ型宣言 + *****************************************************************************/ + +#if !defined(_TYPEDEF_CriUint8) +#define _TYPEDEF_CriUint8 +typedef unsigned char CriUint8; /* 符号なし1バイト整数 */ +#endif + +#if !defined(_TYPEDEF_CriSint8) +#define _TYPEDEF_CriSint8 +typedef signed char CriSint8; /* 符号つき1バイト整数 */ +#endif + +#if !defined(_TYPEDEF_CriUint16) +#define _TYPEDEF_CriUint16 +typedef unsigned short CriUint16; /* 符号なし2バイト整数 */ +#endif + +#if !defined(_TYPEDEF_CriSint16) +#define _TYPEDEF_CriSint16 +typedef signed short CriSint16; /* 符号つき2バイト整数 */ +#endif + +#if !defined(_TYPEDEF_CriUint32) +#define _TYPEDEF_CriUint32 +typedef unsigned int CriUint32; /* 符号なし4バイト整数 */ +#endif + +#if !defined(_TYPEDEF_CriSint32) +#define _TYPEDEF_CriSint32 +typedef signed int CriSint32; /* 符号つき4バイト整数 */ +#endif + +#if !defined(_TYPEDEF_CriUint64) +#define _TYPEDEF_CriUint64 +typedef unsigned long CriUint64; /* 符号なし8バイト整数 */ +#endif + +#if !defined(_TYPEDEF_CriSint64) +#define _TYPEDEF_CriSint64 +typedef signed long CriSint64; /* 符号つき8バイト整数 */ +#endif + +#if !defined(_TYPEDEF_CriUint128) +#define _TYPEDEF_CriUint128 +//typedef unsigned __int128 CriUint128; /* 符号なし16バイト整数 */ +typedef struct { /* 符号なし16バイト整数 */ + CriUint64 h; /* 上位64ビット */ + CriUint64 l; /* 下位64ビット */ +} CriUint128; +#endif + +#if !defined(_TYPEDEF_CriSint128) +#define _TYPEDEF_CriSint128 +//typedef signed __int128 CriSint128; /* 符号つき16バイト整数 */ +typedef struct { /* 符号つき16バイト整数 */ + CriSint64 h; /* 上位64ビット */ + CriUint64 l; /* 下位64ビット */ +} CriSint128; +#endif + +#if !defined(_TYPEDEF_CriFloat16) +#define _TYPEDEF_CriFloat16 +typedef signed short CriFloat16; /* 2バイト実数 */ +#endif + +#if !defined(_TYPEDEF_CriFloat32) +#define _TYPEDEF_CriFloat32 +typedef float CriFloat32; /* 4バイト実数 */ +#endif + +#if !defined(_TYPEDEF_CriFloat64) +#define _TYPEDEF_CriFloat64 +typedef double CriFloat64; /* 8バイト実数 */ +#endif + +#if !defined(_TYPEDEF_CriFixed32) +#define _TYPEDEF_CriFixed32 +typedef signed int CriFixed32; /* 固定小数点32ビット */ +#endif + +#if !defined(_TYPEDEF_CriBool) +#define _TYPEDEF_CriBool +typedef CriSint32 CriBool; /* 論理型(論理定数を値にとる) */ +#endif + +#if !defined(_TYPEDEF_CriChar8) +#define _TYPEDEF_CriChar8 +typedef char CriChar8; /* 文字型 */ +#endif + +/***************************************************************************** + * ポインタを格納可能な整数型 + *****************************************************************************/ +#if !defined(_TYPEDEF_CriSintPtr) +#define _TYPEDEF_CriSintPtr +typedef signed long CriSintPtr; // 8 bytes pointer +#endif + +#if !defined(_TYPEDEF_CriUintPtr) +#define _TYPEDEF_CriUintPtr +typedef unsigned long CriUintPtr; // 8 bytes pointer +#endif + +/***************************************************************************** + * 呼び出し規約 + *****************************************************************************/ + +#if !defined(CRIAPI) +#define CRIAPI +#endif + +#endif /* CRI_INCL_CRI_XPTS_PS4_H */ + +/* end of file */ diff --git a/3rdParty/cri/XboxOne/include/cri_allocator.h b/3rdParty/cri/XboxOne/include/cri_allocator.h new file mode 100644 index 00000000..e3c18997 --- /dev/null +++ b/3rdParty/cri/XboxOne/include/cri_allocator.h @@ -0,0 +1,63 @@ +#ifndef _CRI_ALLOCATOR_H_INCLUDED +#define _CRI_ALLOCATOR_H_INCLUDED +/**************************************************************************** + * * + * CRI Allocator * + * * + * 2006-01-05 written by M.Oshimi * + * * + ****************************************************************************/ + +/**************************************************************************** + * Include file + ****************************************************************************/ +#include +#include "cri_xpt.h" +#include "cri_heap.h" + +/**************************************************************************** + * Macro Constants + ****************************************************************************/ +#if defined(XPT_UNSUPPORT_CPLUSPLUS_THROW) +#define CRI_ALLOCATOR_CPLUSPLUS_THROW +#else +#define CRI_ALLOCATOR_CPLUSPLUS_THROW throw() +#endif + +/**************************************************************************** + * Class Declaration + ****************************************************************************/ +#ifdef __cplusplus + +class CriAllocator +{ +public: + static const CriSint32 DEFAULT_ALIGNMENT = CRIHEAP_DEFAULT_MEM_ALIGN; + + + static void* CRIAPI operator new(size_t size, CriHeap heap) CRI_ALLOCATOR_CPLUSPLUS_THROW; + static void* CRIAPI operator new(size_t size, CriHeap heap, CriHeapType heap_type) CRI_ALLOCATOR_CPLUSPLUS_THROW; + static void* CRIAPI operator new(size_t size, CriHeap heap, const CriChar8 *name, CriUint32 align=DEFAULT_ALIGNMENT) CRI_ALLOCATOR_CPLUSPLUS_THROW; + static void* CRIAPI operator new(size_t size, CriHeap heap, CriHeapType heap_type, const CriChar8 *name, CriUint32 align=DEFAULT_ALIGNMENT) CRI_ALLOCATOR_CPLUSPLUS_THROW; + + static void CRIAPI operator delete(void *p, size_t size); + + static void* CRIAPI operator new(size_t size, void *work, CriSint32 wksize) CRI_ALLOCATOR_CPLUSPLUS_THROW; + static void CRIAPI operator delete(void *p, void *work, CriSint32 wksize) CRI_ALLOCATOR_CPLUSPLUS_THROW; + static void* CRIAPI operator new(size_t size, void *work, CriSint32 wksize, CriUint32 align) CRI_ALLOCATOR_CPLUSPLUS_THROW; + static void CRIAPI operator delete(void *p, void *work, CriSint32 wksize, CriUint32 align) CRI_ALLOCATOR_CPLUSPLUS_THROW; + +#if !defined(XPT_TGT_BCB) + static void CRIAPI operator delete(void *p, CriHeap heap) CRI_ALLOCATOR_CPLUSPLUS_THROW; + static void CRIAPI operator delete(void *p, CriHeap heap, CriHeapType heap_type) CRI_ALLOCATOR_CPLUSPLUS_THROW; + static void CRIAPI operator delete(void *p, CriHeap heap, const CriChar8 *name, CriUint32 align) CRI_ALLOCATOR_CPLUSPLUS_THROW; + static void CRIAPI operator delete(void *p, CriHeap heap, CriHeapType heap_type, const CriChar8 *name, CriUint32 align) CRI_ALLOCATOR_CPLUSPLUS_THROW; +#endif + + static CriSint32 GetWorstExtraSize(CriUint32 align); +}; +#endif // _CRI_ALLOCATOR_H_INCLUDED + +#endif /* end of __cplusplus */ + +/* --- end of file --- */ diff --git a/3rdParty/cri/XboxOne/include/cri_error.h b/3rdParty/cri/XboxOne/include/cri_error.h new file mode 100644 index 00000000..6152a7b5 --- /dev/null +++ b/3rdParty/cri/XboxOne/include/cri_error.h @@ -0,0 +1,368 @@ +#ifndef _CRI_ERROR_H_INCLUDED +#define _CRI_ERROR_H_INCLUDED +/**************************************************************************** + * + * CRI Middleware SDK + * + * Copyright (c) 2006-2009 CRI Middleware Co., Ltd. + * + * Library : CRI Error + * Module : + * File : cri_error.h + * + ****************************************************************************/ +/*! + * \file cri_error.h + */ +/*JP + * \addtogroup CRI_ERROR G[nhOp֐Q + * @{ + */ +/*EN + * \addtogroup CRI_ERROR Functions for error handling + * @{ + */ + +/**************************************************************************** + * Include file * + ****************************************************************************/ +#include "cri_xpt.h" + +/**************************************************************************** + * MACRO CONSTANT * + ****************************************************************************/ + +/* o[Wԍ */ +/* Version number */ +#define CRIERROR_VER_NAME "CRI Error" +#define CRIERROR_VER_NUM "1.04.00" +#define CRIERROR_VER_OPTION + +/*JP + * \brief G[R[h + */ +/*EN + * \brief Error codes + */ +typedef enum { + CRIERR_OK = 0, /*JP< I */ + /*EN< Succeeded */ + CRIERR_NG = -1, /*JP< G[ */ + /*EN< Error occurred */ + CRIERR_INVALID_PARAMETER = -2, /*JP< s */ + /*EN< Invalid argument */ + CRIERR_FAILED_TO_ALLOCATE_MEMORY = -3, /*JP< ̊mۂɎs */ + /*EN< Failed to allocate memory */ + CRIERR_UNSAFE_FUNCTION_CALL = -4, /*JP< XbhZ[t֐̕s */ + /*EN< Parallel execution of thread-unsafe function */ + CRIERR_FUNCTION_NOT_IMPLEMENTED = -5, /*JP< ֐̎s */ + /*EN< Function not implemented */ + CRIERR_LIBRARY_NOT_INITIALIZED = -6, /*JP< Cu */ + /*EN< Library not initialized */ + /* enum be 4bytes */ + CRIERR_ENUM_BE_SINT32 = 0x7FFFFFFF +} CriError; + +/*JP + * \brief G[ʒmx + */ +/*EN + * \brief Error notification level + */ +typedef enum { + CRIERR_NOTIFY_ALL = 0, /*JP< SẴG[ʒm */ + /*EN< Notify all errors */ + CRIERR_NOTIFY_FATAL = 1, /*JP< G[̂ݒʒmix͖j */ + /*EN< Notify error (Disregards warning) */ + /* enum be 4bytes */ + CRIERR_NOTIFY_ENUM_BE_SINT32 = 0x7FFFFFFF +} CriErrorNotificationLevel; + +/* G[x */ +/* Error level */ +typedef enum { + CRIERR_LEVEL_ERROR = 0, + CRIERR_LEVEL_WARNING = 1, + /* enum be 4bytes */ + CRIERR_LEVEL_ENUM_BE_SINT32 = 0x7FFFFFFF +} CriErrorLevel; + +/**************************************************************************** + * PROCESS MACRO * + ****************************************************************************/ + +#if defined(CRIERROR_SIMPLIFY) + /* G[̒ʒm */ + /* Notification of Error */ + #define criErr_NotifyError(id, msg) criErr_NotifyErrorSimple() + #define criErr_NotifyError1(id, msg, p1) criErr_NotifyErrorSimple() + #define criErr_NotifyError2(id, msg, p1, p2) criErr_NotifyErrorSimple() + #define criErr_NotifyErrorPrmArray(id, msg, p1, p2, pa) criErr_NotifyErrorSimple() + #define criErr_NotifyErrorGeneric(_error_id, _error_no) criErr_NotifyErrorSimple() + /* x̒ʒm */ + /* Notification of Warning */ + #define criErr_NotifyWarning(id, msg) criErr_NotifyWarningSimple() + #define criErr_NotifyWarning1(id, msg, p1) criErr_NotifyWarningSimple() + #define criErr_NotifyWarning2(id, msg, p1, p2) criErr_NotifyWarningSimple() + #define criErr_NotifyWarningPrmArray(id, msg, p1, p2, pa) criErr_NotifyWarningSimple() + #define criErr_NotifyWarningGeneric(_error_id, _error_no) criErr_NotifyWarningSimple() +#else + /* G[̒ʒm */ + /* Notification of Error */ + #define criErr_NotifyError(id, msg) criErr_Notify(CRIERR_LEVEL_ERROR, id ":" msg) + #define criErr_NotifyError1(id, msg, p1) criErr_Notify1(CRIERR_LEVEL_ERROR, (id ":" msg), (CriUintPtr)(p1)) + #define criErr_NotifyError2(id, msg, p1, p2) criErr_Notify2(CRIERR_LEVEL_ERROR, (id ":" msg), (CriUintPtr)(p1), (CriUintPtr)(p2)) + #define criErr_NotifyErrorPrmArray(id, msg, p1, p2, pa) criErr_NotifyPrmArray(CRIERR_LEVEL_ERROR, (id ":" msg), (CriUintPtr)(p1), (CriUintPtr)(p2), (CriUintPtr *)(pa)) + #define criErr_NotifyErrorGeneric(_error_id, _error_no) criErr_NotifyGeneric(CRIERR_LEVEL_ERROR, _error_id, _error_no) + /* x̒ʒm */ + /* Notification of Warning */ + #define criErr_NotifyWarning(id, msg) criErr_Notify(CRIERR_LEVEL_WARNING, id ":" msg) + #define criErr_NotifyWarning1(id, msg, p1) criErr_Notify1(CRIERR_LEVEL_WARNING, (id ":" msg), (CriUintPtr)(p1)) + #define criErr_NotifyWarning2(id, msg, p1, p2) criErr_Notify2(CRIERR_LEVEL_WARNING, (id ":" msg), (CriUintPtr)(p1), (CriUintPtr)(p2)) + #define criErr_NotifyWarningPrmArray(id, msg, p1, p2, pa) criErr_NotifyPrmArray(CRIERR_LEVEL_WARNING, (id ":" msg), (CriUintPtr)(p1), (CriUintPtr)(p2), (CriUintPtr *)(pa)) + #define criErr_NotifyWarningGeneric(_error_id, _error_no) criErr_NotifyGeneric(CRIERR_LEVEL_WARNING, _error_id, _error_no) +#endif + +/**************************************************************************** + * Data type declaration * + ****************************************************************************/ + +/* Error Callback Function type */ +typedef void (CRIAPI *CriErrCbFunc)(const CriChar8 *errid, CriUint32 p1, CriUint32 p2, CriUint32 *parray); + +/**************************************************************************** + * ϐ̐錾 * + * Variable Declaration * + ****************************************************************************/ +/* G[o͏ȗpϐ */ +/* default argument of CriError */ +#ifdef __cplusplus +namespace criErr { + extern CriError ErrorContainer; +} +#endif /* __cplusplus */ + +/**************************************************************************** + * ֐̐錾 * + * Function Declaration * + ****************************************************************************/ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +/*JP + * \brief G[ID񂩂G[bZ[W֕ϊ + * \ingroup CRI_ERROR + * \param[in] errid G[ID + * \return G[bZ[W + * \par : + * G[ID񂩂ڍׂȃG[bZ[W֕ϊ܂B
+ * \attention + * ̊֐͋dl̊֐łB
+ * ::criErr_ConvertIdToMessage ֐gpĂB + * \sa criErr_ConvertIdToMessage + */ +/*EN + * \brief Convert error ID to error message + * \ingroup CRI_ERROR + * \param[in] errid error ID + * \return error message + * \par Explanation: + * This function converts error ID to detailed error message.
+ * \attention + * This function is an obsolete one.
+ * Please use the ::criErr_ConvertIdToMessage function instead. + * \sa criErr_ConvertIdToMessage + */ +const CriChar8* CRIAPI criErr_ConvertIdToMsg(const CriChar8 *errid); + +/*JP + * \brief G[ID񂩂G[bZ[W֕ϊ + * \ingroup CRI_ERROR + * \param[in] errid G[ID + * \param[in] p1 ⑫1 + * \param[in] p2 ⑫2 + * \return G[bZ[W + * \par : + * G[ID񂩂ڍׂȃG[bZ[W֕ϊ܂B
+ * \par p: + * \code + * void user_error_callback_func(const CriChar8 *errid, CriUint32 p1, CriUint32 p2, CriUint32 *parray); + * { + * const CriChar8 *errmsg; + * errmsg = criErr_ConvertIdToMessage(errid, p1, p2); + * printf("%s\n", errmsg); + * } + * \endcode + */ +/*EN + * \brief Convert error ID to error message + * \ingroup CRI_ERROR + * \param[in] errid error ID + * \param[in] p1 supplementary information 1 + * \param[in] p2 supplementary information 2 + * \return error message + * \par Explanation: + * This function converts error ID to detailed error message.
+ * \par Example: + * \code + * void user_error_callback_func(const CriChar8 *errid, CriUint32 p1, CriUint32 p2, CriUint32 *parray); + * { + * const CriChar8 *errmsg; + * errmsg = criErr_ConvertIdToMessage(errid, p1, p2); + * printf("%s\n", errmsg); + * } + * \endcode + */ +const CriChar8* CRIAPI criErr_ConvertIdToMessage(const CriChar8 *errid, CriUint32 p1, CriUint32 p2); + +/*JP + * \brief G[R[obN֐̓o^ + * \ingroup CRI_ERROR + * \param[in] cbf G[R[obN֐ + * \return Ȃ + * \par : + * G[R[obN֐o^܂B
+ * o^ꂽ֐́ACRI~hEGACuŃG[ƂɌĂяo܂B
+ * ɓo^łG[R[obN֐͂P‚łB
+ * o^ɍēx{֐Ăяoꍇ݂͌̓o^㏑܂B + * \par p: + * \code + * void user_error_callback_func(const CriChar8 *errid, CriUint32 p1, CriUint32 p2, CriUint32 *parray); + * { + * const CriChar8 *errmsg; + * errmsg = criErr_ConvertIdToMessage(errid, p1, p2); + * printf("%s\n", errmsg); + * } + * + * void main(int ac, char *av[]) + * { + * F + * // G[R[obN̓o^ + * criErr_SetCallback(user_error_callback_func); + * F + * } + * \endcode + */ +/*EN + * \brief Register error callback function + * \ingroup CRI_ERROR + * \param[in] cbf error callback function + * \return NONE + * \par Explanation: + * This function registers an error callback function.
+ * The registered function is called if an error occurs within the CRI middleware library. + * \par Example: + * \code + * void user_error_callback_func(const CriChar8 *errid, CriUint32 p1, CriUint32 p2, CriUint32 *parray); + * { + * const CriChar8 *errmsg; + * errmsg = criErr_ConvertIdToMessage(errid, p1, p2); + * printf("%s\n", errmsg); + * } + * + * void main(int ac, char *av[]) + * { + * : + * // Registers the error callback function + * criErr_SetCallback(user_error_callback_func); + * : + * } + * \endcode + */ +void CRIAPI criErr_SetCallback(CriErrCbFunc cbf); + +/*JP + * \brief G[ʒmx̕ύX + * \ingroup CRI_ERROR + * \param[in] level G[ʒmx + * \return Ȃ + * \par : + * G[R[obNɒʒmG[̃xύX܂B + */ +/*EN + * \brief Change error notification level + * \ingroup CRI_ERROR + * \param[in] level error notification level + * \return NONE + * \par Explanation: + * This function changes the level of error information that is notified to the error callback. + */ +void CRIAPI criErr_SetErrorNotificationLevel(CriErrorNotificationLevel level); + +/*JP + * \brief G[񐔂̎擾 + * \ingroup CRI_ERROR + * \param[in] level G[x + * \return G[ + * \par : + * G[񐔂擾܂B + */ +/*EN + * \brief Retrieve error count + * \ingroup CRI_ERROR + * \param[in] level error level + * \return number of errors occured + * \par Explanation: + * This function retrieves the number of errors occured. + */ +CriUint32 CRIAPI criErr_GetErrorCount(CriErrorLevel level); + +/*JP + * \brief G[񐔂̃Zbg + * \ingroup CRI_ERROR + * \param[in] level G[x + * \return Ȃ + * \par : + * G[񐔂̃JE^0ɖ߂܂B + */ +/*EN + * \brief Resets error count + * \ingroup CRI_ERROR + * \param[in] level error level + * \return NONE + * \par Explanation: + * This function resets the counter for number of errors occured. + */ +void CRIAPI criErr_ResetErrorCount(CriErrorLevel level); + +/* G[R[obN𔭐 (֐) */ +/* Error notification (Internal functions) */ +void CRIAPI criErr_Notify(CriErrorLevel level, const CriChar8 *errid); +void CRIAPI criErr_Notify1(CriErrorLevel level, const CriChar8 *errid, CriUintPtr p1); +void CRIAPI criErr_Notify2(CriErrorLevel level, const CriChar8 *errid, CriUintPtr p1, CriUintPtr p2); +void CRIAPI criErr_NotifyPrmArray(CriErrorLevel level, const CriChar8 *errid, CriUintPtr p1, CriUintPtr p2, CriUintPtr *pa); +void CRIAPI criErr_NotifyGeneric(CriErrorLevel level, const CriChar8 *error_id, CriError error_no); +void CRIAPI criErr_NotifyErrorSimple(void); +void CRIAPI criErr_NotifyWarningSimple(void); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +/*************************************************************************** + * o[WƂ̌݊p + * For compatibility with old versions + ***************************************************************************/ +#define criErr_Invoke(errid) criErr_Notify(CRIERR_LEVEL_ERROR, errid) +#define criErr_Invoke1(errid, p1) criErr_Notify1(CRIERR_LEVEL_ERROR, errid, p1) +#define criErr_Invoke2(errid, p1, p2) criErr_Notify2(CRIERR_LEVEL_ERROR, errid, p1, p2) +#define criErr_InvokePrmArray(errid, p1, p2, pa) criErr_NotifyPrmArray(CRIERR_LEVEL_ERROR, errid, p1, p2, pa) +#define criErr_InvokeGeneric(error_id, error_no) criErr_NotifyGeneric(CRIERR_LEVEL_ERROR, error_id, error_no) +#define criErr_Occur(id, msg) criErr_Notify(CRIERR_LEVEL_ERROR, id ":" msg) +#define criErr_Occur1(id, msg, p1) criErr_Notify1(CRIERR_LEVEL_ERROR, (id ":" msg), (CriUintPtr)(p1)) +#define criErr_Occur2(id, msg, p1, p2) criErr_Notify2(CRIERR_LEVEL_ERROR, (id ":" msg), (CriUintPtr)(p1), (CriUintPtr)(p2)) +#define criErr_OccurPrmArray(id, msg, p1, p2, pa) criErr_NotifyPrmArray(CRIERR_LEVEL_ERROR, (id ":" msg), (CriUintPtr)(p1), (CriUintPtr)(p2), (CriUintPtr*)(pa)) +#define criErr_OccurGeneric(_error_id, _error_no) criErr_NotifyGeneric(CRIERR_LEVEL_ERROR, _error_id, _error_no) + +/*EN + * @} + */ +/*JP + * @} + */ + +#endif // _CRI_ERROR_H_INCLUDED + +/* --- end of file --- */ diff --git a/3rdParty/cri/XboxOne/include/cri_heap.h b/3rdParty/cri/XboxOne/include/cri_heap.h new file mode 100644 index 00000000..488306bb --- /dev/null +++ b/3rdParty/cri/XboxOne/include/cri_heap.h @@ -0,0 +1,640 @@ +#ifndef _CRI_HEAP_H_INCLUDED +#define _CRI_HEAP_H_INCLUDED +/**************************************************************************** + * * + * CRI Heap Manager "CriHeap" Library * + * * + * 2005-03-17 written by satouo * + * * + ****************************************************************************/ +/*! + * \file cri_heap.h + */ + +/**************************************************************************** + * CN[ht@C * + * Include file * + ****************************************************************************/ +#include "cri_xpt.h" + +#ifdef XPT_TGT_PC +#pragma pack(push) +#pragma pack(1) //The boundary value of structure is adjusted to 1 byte. +#endif + +/**************************************************************************** + * 萔}N * + * MACRO CONSTANT * + ****************************************************************************/ +/* Version number of CRIHEAP */ +#define CRIHEAP_NAME_STRINGS "CRI Heap" +#define CRIHEAP_VERSION_STRINGS "1.21.02" + +/* Default memory alignment */ +#define CRIHEAP_DEFAULT_MEM_ALIGN (8) + +/**************************************************************************** + * 񋓒萔}N * + * ENUM CONSTANT * + ****************************************************************************/ +/*JP + * \brief ̃^Cv + */ +/*EN + * \brief Types of heap + */ +typedef enum { + CRIHEAP_TYPE_FIX = (1), + CRIHEAP_TYPE_TEMPORARY = (2), + CRIHEAP_TYPE_DYNAMIC = (3), // unuse + CRIHEAP_TYPE_NONE = (0), + /* enum be 4bytes */ + CRIHEAP_TYPE_ENUM_BE_SINT32 = 0x7FFFFFFF +} CriHeapType; + +/**************************************************************************** + * f[^^ * + * Data type declaration * + ****************************************************************************/ +/* CriHeapnh */ +/* CriHeap handle */ +#ifndef CRIHEAP_DEFINED +#define CRIHEAP_DEFINED + +/* internal */ +typedef struct CriHeapBlockTag { + struct CriHeapBlockTag *prevblock; + struct CriHeapBlockTag *nextblock; + CriSint32 memsize; + CriUint8 used; + CriUint8 type; + CriUint16 alignspc; + CriUint16 gap; + CriChar8 *nameadr; +} CriHeapBlock, *CriHeapBlockPtr; + +/*JP + * \brief CRI Heapnh + * \struct CriHeap + * \ingroup CRIHEAP_BASIC + * CRI HeappăAP[gs߂ɕKvȃnhłB
+ * ̃nhɑ΂āAAP[g⃁t[s܂B + * \sa criHeap_Create(), criHeap_Destroy() + */ +/*EN + * \brief CRI Heap handle + * \struct CriHeap + * \ingroup CRIHEAP_BASIC + * \par Description: + * The heap handle. This data structure needs to exist through the life cycle of + * the heap. It allows the library to allocate and deallocate memory + * internally within the heap. Typically this handle gets allocated at the + * beginning of the heap memory that you've provided for the heap, but don't + * depend on this behavior. The heap itself is opaque. You can of course + * allocate multiple non-contiguous heaps, but these will be separate heap + * structures and a single allocation won't choose between them. + * + * \sa criHeap_Create(), criHeap_Destroy() + */ +typedef struct _criheap_struct { + struct _criheap_vfunctiontable *vtbl; + CriSint32 totalsize; + CriSint32 peaksize; + CriSint32 currentsize; + CriHeapBlock *topblock; + CriHeapBlock *taleblock; +} CriHeapObj, *CriHeap; + +/*JP + * \brief CRI Heapz֐e[u + * \struct criHeapVirtualFunctionTable + * \ingroup CRIHEAP_BASIC + * Ǝ̃AP[g֐ۂɎgp鉼z֐e[u\̂łB
+ * e֐̓}`XbhZ[tłKv܂B
+ * \par l: + * RԖڂ̃AP[g֐͌ݖgpłB + */ +/*EN + * \brief CRI Heap Virtual Function Table + * \struct criHeapVirtualFunctionTable + * \ingroup CRIHEAP_BASIC + * \par Description: + * The virtual functions table for original allocation functions.
+ * The third allocation function is not in use currently. + */ +typedef struct _criheap_vfunctiontable { + /*JP + * \brief ̃AP[gï̐[j + * \par : + * criHeap_AllocFix֐ĂяoɌĂ΂܂B + * \sa criHeap_AllocFix() + */ + /*EN + * \brief Memory allocation (allocating from the top of the memory area) + * \par Description: + * Called from criHeap_AllocFix(). + * \sa criHeap_AllocFix() + */ + void *(*AllocFix)(CriHeap heap, CriSint32 size, const CriChar8 *name, CriSint32 align); + /*JP + * \brief ̃AP[gï̏I[j + * \par : + * criHeap_AllocFix֐ĂяoɌĂ΂܂B + * \sa criHeap_AllocTemporary() + */ + /*EN + * \brief Memory allocation (allocating from the tail of the memory area) + * \par Description: + * Called from criHeap_AllocTemporary(). + * \sa criHeap_AllocTemporary() + */ + void *(*AllocTemporary)(CriHeap heap, CriSint32 size, const CriChar8 *name, CriSint32 align); + /*JP + * \brief gp֐ + */ + /*EN + * \brief Unused + */ + void *(*AllocDynamic)(CriHeap heap, CriSint32 size, const CriChar8 *name, CriSint32 align); // unused + + /*JP + * \brief ̃t[ + * \par : + * criHeap_Free֐ĂяoɌĂ΂܂B + * \sa criHeap_Free() + */ + /*EN + * \brief Memory deallocation + * \par Description: + * Called from criHeap_Free(). + * \sa criHeap_Free() + */ + CriSint32 (*Free)(CriHeap heap, void *ptr); +} criHeapVirtualFunctionTable; + +#endif + + +/**************************************************************************** + * ֐̐錾 + * Function Declaration + ****************************************************************************/ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +/*==========================================================================* + * CȕƏI + * Initialize and Finalize of Library + *==========================================================================*/ +/*JP + * \brief CRI HeapCȕ + * \ingroup CRIHEAP_BASIC + * \par : + * CRI HeapCugp邽߂ɕKvȏ֐łB
+ * CRI Heapgpۂ͂炩ߖ{֐R[Kv܂B + * \sa criHeap_Finalize() + */ +/*EN + * \brief Initialize the heap manager. + * \ingroup CRIHEAP_BASIC + * \par Description: + * This function initializes the heap manager and prepares it to manage heaps. + * This function only has an effect the first time it is called in your program. + * Subsequent calls only increment an internal counter. This allows your + * program to call criHeap_Initialize() in pairs with criHeap_Finalize() + * throughout your program modules, and only the initial call to criHeap_Initialize() + * and the final call to criHeap_Finalize() will have any effect. + * \if ps2 + * \par PS2 only: + * This function does a sanity check to make sure that the size of the CriHeapObj + * data structure is a factor of 16. If it is not a factor of 16, this function + * hangs. + * \endif + * \sa criHeap_Finalize() + */ +void CRIAPI criHeap_Initialize(void); + +/*JP + * \brief CRI HeapCȕI + * \ingroup CRIHEAP_BASIC + * \par : + * CRI HeapCuI邽߂ɕKvȏI֐łB
+ * CRI Heap̎gpIۂ͖{֐R[ĂB + * \sa criHeap_Initialize() + */ +/*EN + * \brief Finalize the heap manager. + * \ingroup CRIHEAP_BASIC + * \par Description: + * This function finalizes the heap manager. If the criHeap_Initialize() function + * is called n times, then the nth time that criHeap_Finalize() + * is called, this function invalidates any heaps currently in use. Calling + * any heap function after the nth call to criHeap_Finalize() will + * have unpredictable results. + * \sa criHeap_Initialize() + */ +void CRIAPI criHeap_Finalize(void); + +/*==========================================================================* + * nh̐E + *==========================================================================*/ +/*JP + * \brief CRI Heapnh̐ + * \ingroup CRIHEAP_BASIC + * \param ptr ̈̃|C^B + * \param size ̈̃TCYB + * \return CRI HeapnhB
Ɏsꍇ́ANULLԂ܂B + * \par : + * CRI Heapnh𐶐܂B
+ * {֐ŗ^郁̈́ACRI Heapg̃nḧAP[g + * mۂ郁̈ƂȂ܂B
+ * Ǘ̈܂ނ߁Ä悷ׂĂAP[goȂ_ɒӂĂB + * Ǘ̖̈ڈ́uPnhsizeof(CriHeapObj)v{uPAP[g + * sizeof(CriHeapBlock){eACgɕKvȃTCYvƂȂ܂B + * \code + * CriChar8 heap_buffer[0x2000]; + * CriHeap heap = criHeap_Create((void *)heap_buffer, sizeof(heap_buffer); + * \endcode + * \sa criHeap_Destroy() + */ +/*EN + * \brief Create a contiguous heap in memory. + * \ingroup CRIHEAP_BASIC + * \param ptr A pointer to the start of the memory region to use as a heap. + * \param size The size of the region to be used as a heap. + * \return A valid CriHeap handle if successful, or NULL if unsuccessful. + * \par Description: + * This function allows you to set aside a region of memory for this library's + * use as a "heap". Heap allocation is required before active playback + * can begin. + * This function will fail and return NULL if the size of the memory region + * is smaller than the CriHeapObj structure. + * \code + * CriChar8 heap_buffer[0x2000]; + * CriHeap heap = criHeap_Create((void *)heap_buffer, sizeof(heap_buffer); + * \endcode + * \sa criHeap_Destroy() + */ +CriHeap CRIAPI criHeap_Create(void *ptr, CriSint32 size); + +/*JP + * \brief XbhZ[tCRI Heapnh̐ + * \ingroup CRIHEAP_BASIC + * \param ptr ̈̃|C^B + * \param size ̈̃TCYB + * \return CRI HeapnhB
Ɏsꍇ́ANULLԂ܂B + * \par : + * CRI Heapnh𐶐܂B
+ * {֐gpč쐬ꂽq[v́Ar䂪sȂ܂B
+ * Xbh瓯ɎQƂq[v̍쐬ɂ́AcriHeap_Create֐pB + * \sa criHeap_Create(), criHeap_Destroy() + */ +/*EN + * \brief Create a contiguous heap in memory. + * \ingroup CRIHEAP_BASIC + * \param ptr A pointer to the start of the memory region to use as a heap. + * \param size The size of the region to be used as a heap. + * \return A valid CriHeap handle if successful, or NULL if unsuccessful. + * \par Description: + * This function creates a heap to use the static memory as dynamically allocatable memory. + * The heap created by using this function is not threadsafe. + * If heap will be accessed by multiple threads, you must create the heap by using the criHeap_Create function. + * \sa criHeap_Create(), criHeap_Destroy() + */ +CriHeap CRIAPI criHeap_CreateNoSerialize(void *ptr, CriSint32 size); + +/*JP + * \brief CRI Heapnh̉ + * \ingroup CRIHEAP_BASIC + * \param heap CRI HeapnhB + * \par : + * CRI Heapnh܂B
criHeap_Create() Ŏw肳ꂽ̈悪 + * ACRI Heapnh͖ƂȂ܂B + * \sa criHeap_Create() + */ +/*EN + * \brief Destroy a previously created heap. + * \ingroup CRIHEAP_BASIC + * \param heap A CriHeap handle previously created with criHeap_Create(). + * \par Description: + * This function frees all internal allocations previously performed on + * the heap and frees the memory. Internally, this function does in + * fact walk through the heap, finding and freeing all allocations, e.g. + * it is not stubbed. So calling this function on a trashed heap + * will have unpredictable results. + * \sa criHeap_Create() + */ +void CRIAPI criHeap_Destroy(CriHeap heap); + +/*==========================================================================* + * Allocation + *==========================================================================*/ +/*JP + * \brief ̃AP[gï̐[j + * \ingroup CRIHEAP_ALLOC + * \param heap CRI HeapnhB + * \param size AP[g郁̃TCYB + * \param name AP[g郁̖OBO̓fobOɎgp܂B + * \param align AP[g郁̃ACgB + * \return AP[gւ̃|C^B
AP[gɎsꍇNULLԂ܂B + * \par : + * ̈̐[mۂ郁AP[V֐łBq[v̈\ref block_fix "FixubN"쐬܂B
+ * ̒fЉh߁ATCY^ACg̉ς\ref block_fix "FixubN"[TāAėp悤Ɏ݂܂Bꂪ‚Ȃꍇ́Agp̋󂫗̈i\ref block_free "FreeubN"j𕪊ă擾܂B + * \code + * CriChar8 heap_buffer[0x2000]; + * CriHeap heap = criHeap_Create((void *)heap_buffer, sizeof(heap_buffer); + * void *memptr = criHeap_AllocFix(heap, 0x100, "forTexture1", 64); + * \endcode + * \sa criHeap_AllocTemporary(), criHeap_Free() + */ +/*EN + * \brief Memory allocation (allocating from the top of the memory area) + * \ingroup CRIHEAP_ALLOC + * \param heap CRI Heap handle + * \param size Memory block size to be allocated + * \param name Memory block name, which is used on debugging + * \param align Memory block alignment + * \return A pointer to the allocated memory block.
Returns NULL if unsuccessful. + * \par Description: + * This function allocates a memory block from the top of the memory area and creates a \ref block_fix "Fix block" in the heap area.
+ * To prevent memory fragmentation, a released \ref block_fix "Fix block" with the same size and alignment is searched for in the heap area from the top to the bottom and tries to reused the block. And if not found, an unused free block (\ref block_free "Free block") is divided and a new block is allocated. + * \code + * CriChar8 heap_buffer[0x2000]; + * CriHeap heap = criHeap_Create((void *)heap_buffer, sizeof(heap_buffer); + * void *memptr = criHeap_AllocFix(heap, 0x100, "forTexture1", 64); + * \endcode + * \sa criHeap_AllocTemporary(), criHeap_Free() + */ +void * CRIAPI criHeap_AllocFix(CriHeap heap, CriSint32 size, const CriChar8 *name, CriSint32 align); + +/*JP + * \brief ̃AP[gï̏I[j + * \ingroup CRIHEAP_ALLOC + * \param heap CRI HeapnhB + * \param size AP[g郁̃TCYB + * \param name AP[g郁̖OBO̓fobOɎgp܂B + * \param align AP[g郁̃ACgB + * \return AP[gւ̃|C^B
AP[gɎsꍇNULLԂ܂B + * \par : + * ̈̏I[mۂ郁AP[V֐łBq[v̈\ref block_temporary "TemporaryubN"쐬܂B
+ * vTCY^ACgAP[g”\ȉς\ref block_temporary "TemporaryubN"I[TāA܂͍ėp悤Ɏ݂܂Bꂪ‚Ȃꍇ́Agp̋󂫗̈i\ref block_free "FreeubN"j𕪊ă擾܂B
+ * q[v̈̏I[烁AP[g邽߁A[ł̒fЉhƂo܂B
+ * ɁAꎞIɗp郁Ɏgp܂B + * \sa criHeap_AllocFix(), criHeap_Free() + */ +/*EN + * \brief Memory allocation (allocating from the tail of the memory area) + * \ingroup CRIHEAP_ALLOC + * \param heap CRI Heap handle + * \param size Memory block size to be allocated + * \param name Memory block name, which is used on debugging + * \param align Memory block alignment + * \return A pointer to the allocated memory block.
Returns NULL if unsuccessful. + * \par Description: + * This function allocates a memory block from the bottom of the memory area and creates a \ref block_temporary "Temporary block" in the heap area.
+ * A released \ref block_temporary "Temporary block" available with the requested size and alignment is searched for in the heap area from the bottom and tries to divide and to reuse the block. And if not found, an unused free block (\ref block_free "Free block") is divided and a new block is allocated.
+ * Allocating from the bottom of the heap area will prevent fragmentation in the top of the heap area.
+ * Temporary block is mainly used for the memory area that is temporarily used. + * \sa criHeap_AllocFix(), criHeap_Free() + */ +void * CRIAPI criHeap_AllocTemporary(CriHeap heap, CriSint32 size, const CriChar8 *name, CriSint32 align); + +/* DYNAMIC (unuse) */ +//void * CRIAPI criHeap_AllocDynamic(CriHeap heap, CriSint32 size, const CriChar8 *name, CriSint32 align); + +void * CRIAPI criHeap_Alloc(CriHeap heap, CriSint32 size, const CriChar8 *name, CriSint32 align, CriSint32 type); + +/*==========================================================================* + * Free + *==========================================================================*/ +/*JP + * \brief ̃t[ + * \ingroup CRIHEAP_ALLOC + * \param heap CRI HeapnhB + * \param ptr AP[g̃|C^B + * \return t[ꂽTCYB + * \par : + * AP[gꂽt[܂B
+ * \code + * void *memptr = criHeap_AllocFix(heap, 0x100, "forTexture1", 64); + * criHeap_Free(heap, memptr); + * \endcode + * \sa criHeap_AllocFix(), criHeap_AllocTemporary() + */ +/*EN + * \brief Memory deallocation + * \ingroup CRIHEAP_ALLOC + * \param heap CRI Heap handle + * \param ptr The pointer to the allocated memory block + * \return Deallocated memory block size + * \par Description: + * This function deallocates the allocated memory block.
+ * \code + * void *memptr = criHeap_AllocFix(heap, 0x100, "forTexture1", 64); + * criHeap_Free(heap, memptr); + * \endcode + * \sa criHeap_AllocFix(), criHeap_AllocTemporary() + */ +CriSint32 CRIAPI criHeap_Free(CriHeap heap, void *ptr); + +/*==========================================================================* + * rp֐ + *==========================================================================*/ +CriSint32 CRIAPI criHeap_EnterCriticalSection(void); +CriSint32 CRIAPI criHeap_LeaveCriticalSection(void); + +/*==========================================================================* + * ̑̊֐ + *==========================================================================*/ +/* For only internal use */ +CriSint32 CRIAPI criHeap_SwitchAllocFunctions(CriHeap heap); + +/*==========================================================================* + * fobO֘A + *==========================================================================*/ +/*JP + * \brief s[NTCY̎擾 + * \ingroup CRIHEAP_DEBUG + * \param heap CRI HeapnhB + * \return gpꂽ̍őlB + * \par : + * ߋAgpꂽʂ̍őlԂ܂B
+ * őlcriHeap_DebugResetPeakMemorySize() ŃZbg邱Ƃo܂B + * \sa criHeap_DebugResetPeakMemorySize() + */ +/*EN + * \brief Returns peak memory usage of the heap. + * \ingroup CRIHEAP_DEBUG + * \param heap The heap previously allocated by criHeap_Create(). + * \return The maximum number of bytes used by the heap. + * \par Description: + * The amount of memory used by these libraries is variable and depends + * on the number of simultaneous streams being read, the seek and error + * frequency within the stream being read, video resolution and other + * factors. This function allows you to tune the allocation of the heap + * to achieve a required performance level while allocating minimal + * heap space for this library. To get accurate readings, this function + * should typically be called just before criHeap_Destroy(), and after + * exercising all the video and audio functions in your program. + */ +CriSint32 CRIAPI criHeap_DebugGetPeakMemorySize(CriHeap heap); + +/*JP + * \brief s[NTCỸZbg + * \ingroup CRIHEAP_DEBUG + * \param heap CRI HeapnhB + * \par : + * s[NTCYZbg܂B + * \sa criHeap_DebugGetPeakMemorySize() + */ +/*EN + * \brief Reset peak memory size + * \ingroup CRIHEAP_DEBUG + * \param heap CRI Heap handle + * \par Description: + * The peak memory size is reset. + * \sa criHeap_DebugGetPeakMemorySize() + */ +void CRIAPI criHeap_DebugResetPeakMemorySize(CriHeap heap); + +/*JP + * \brief ubN̎擾 + * \ingroup CRIHEAP_DEBUG + * \param heap CRI HeapnhB + * \return ubNB + * \par : + * AP[gꂽ̃ubNԂ܂B
+ * CRI Heapnh͖gp̃ubNP‘݂ + * ƂȂ܂B܂At[ꂽfЉꂽubN̐ + * ܂݂܂B + * \sa criHeap_DebugGetUsedBlocks() + */ +/*EN + * \brief Get number of allocated memory blocks + * \ingroup CRIHEAP_DEBUG + * \param heap CRI Heap handle + * \return Number of allocated memory blocks + * \par Description: + * The number of allocated memory blocks is returned.
+ * One unused memory block exists right after CRI Heap handle creation. + * The number of released fragmented memory blocks is also included. + * \sa criHeap_DebugGetUsedBlocks() + */ + CriSint32 CRIAPI criHeap_DebugGetNumBlocks(CriHeap heap); + +/*JP + * \brief gpubN̎擾 + * \ingroup CRIHEAP_DEBUG + * \param heap CRI HeapnhB + * \return gpubNB + * \par : + * AP[gĂ郁ubN̐Ԃ܂B + * \sa criHeap_DebugGetNumBlocks() + */ +/*EN + * \brief Get number of used memory blocks + * \ingroup CRIHEAP_DEBUG + * \param heap CRI Heap + * \return Number of used memory blocks + * \par Description: + * The number of used memory blocks is returned.
+ * \sa criHeap_DebugGetNumBlocks() + */ +CriSint32 CRIAPI criHeap_DebugGetUsedBlocks(CriHeap heap); + +/*JP + * \brief ubN̎擾 + * \ingroup CRIHEAP_DEBUG + * \param heap CRI HeapnhB + * \param ptr AP[g̃|C^B + * \return ubNB + * \par : + * AP[gɐݒ肵ubNւ̃|C^Ԃ܂B
+ */ +/*EN + * \brief Get memory block name + * \ingroup CRIHEAP_DEBUG + * \param heap CRI Heap + * \param ptr A pointer to the allocated memory block + * \return Memory block name + * \par Description: + * The pointer to the memory block name specified on allocation is returned.
+ */ +CriChar8 * CRIAPI criHeap_DebugGetBlockName(CriHeap heap, void *ptr); + +/* ubNԍ̎擾 */ +//CriSint32 CRIAPI criHeap_DebugGetBlockNumberFromPointer(CriHeap heap, void *ptr); + +/* ubN̎擾 */ +//void CRIAPI criHeap_DebugGetBlockInformation(CriHeap heap, +// CriSint32 blocknumber, CriHeapBlock *heapblock); + +/* ubN̕\ */ +//void CRIAPI criHeap_DebugPrintBlockInformation(CriHeap heap, +// CriSint32 blocknumber, CriHeapBlock *heapblock); + +/*JP + * \brief ubN̕\ + * \ingroup CRIHEAP_DEBUG + * \param heap CRI HeapnhB + * \par : + * ݂̃ubN\܂B
+ * printf֐Ȃǂ̕Wo͂ɕ\s܂B + */ +/*EN + * \brief Print memory block information + * \ingroup CRIHEAP_DEBUG + * \param heap CRI Heap + * \par Description: + * The current memory block information is displayed.
+ * It is displayed on the standard output for the printf function. + */ + void CRIAPI criHeap_DebugPrintBlockInformationAll(CriHeap heap); + +/*JP + * \brief AP[gTCY̎擾 + * \ingroup CRIHEAP_DEBUG + * \param heap CRI HeapnhB + * \par : + * ݂̃AP[gTCY̍vlԂ܂B + */ +/*EN + * \brief Get total allocation size + * \ingroup CRIHEAP_DEBUG + * \param heap CRI Heap + * \par Description: + * The total size of allocated memory blocks is returned. + */ +CriSint32 CRIAPI criHeap_DebugGetTotalAllocSize(CriHeap heap); + +/* t[TCY̎擾 */ +//CriSint32 CRIAPI criHeap_DebugGetTotalFreeSize(CriHeap heap); + +/* AP[gTCY̎擾(^Cv) */ +CriSint32 CRIAPI criHeap_DebugGetAllocSize(CriHeap heap, CriSint32 type); + +/* q[vwb_TCY̎擾 */ +CriSint64 CRIAPI criHeap_DebugGetHandleHeaderSize(CriHeap heap); + +/* ubNwb_TCY̎擾 ptr: Allocated Pointer */ +CriSint64 CRIAPI criHeap_DebugGetMemBlockHeaderSize(void *ptr); + +/* ljŕKvƂȂTCY̍ől */ +CriSint32 CRIAPI criHeap_DebugGetWorstExtraSize(CriSint32 alignment); + +/* criHeap_AllocFixŃAP[g”\ȃTCY */ +CriSint32 CRIAPI criHeap_DebugGetFixAllocatableSize(CriHeap heap, CriSint32 alignment); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#ifdef XPT_TGT_PC +#pragma pack(pop) +#endif + +#endif // _CRI_HEAP_H_INCLUDED + +/* end of file */ diff --git a/3rdParty/cri/XboxOne/include/cri_movie.h b/3rdParty/cri/XboxOne/include/cri_movie.h new file mode 100644 index 00000000..1c0db2f8 --- /dev/null +++ b/3rdParty/cri/XboxOne/include/cri_movie.h @@ -0,0 +1,4402 @@ +/**************************************************************************** + * + * CRI Middleware SDK + * + * Copyright (c) 2006-2013 CRI Middleware Co., Ltd. + * + * Library : CRI Movie + * Module : Library User's Header + * File : cri_movie.h + * Date : 2013-11-27 + * Version : (see CRIMOVIE_VER) + * + ****************************************************************************/ +/*! + * \file cri_movie.h + */ +#ifndef CRI_MOVIE_H_INCLUDED /* Re-definition prevention */ +#define CRI_MOVIE_H_INCLUDED + +/* Version No. */ +#define CRIMOVIE_VER "3.50" +#define CRIMOVIE_NAME "CRI Movie" + +/*************************************************************************** + * Include file + ***************************************************************************/ +#include +#include +#include +#include +#include +#include + +/*************************************************************************** + * MACRO CONSTANT + ***************************************************************************/ +/*EN + * \brief Maximum length of a filename that can be opened by EasyPlayer + * \ingroup MDL_MV_OPTION + * \sa CriMvEasyPlayer::SetFile() + */ +/*JP + * \brief EasyPlayerɎw”\ȃt@C̍ő咷 + * \ingroup MDL_MV_OPTION + * \sa CriMvEasyPlayer::SetFile() + */ +#define CRIMV_MAX_FILE_NAME (256) + +/*EN + * \brief Default audio track setting used by AttachSubAudioInterface(), ReplaceCenterVoice() + * \ingroup MDL_MV_OPTION + * \sa CriMvEasyPlayer::ReplaceCenterVoice(), CriMvEasyPlayer::AttachSubAudioInterface() + */ +/*JP + * \brief TuI[fBIi܂̓Z^[{CXj̃ftHgl + * \ingroup MDL_MV_OPTION + * \sa CriMvEasyPlayer::ReplaceCenterVoice(), CriMvEasyPlayer::AttachSubAudioInterface() + */ +#define CRIMV_CENTER_VOICE_OFF (-1) + + +/*************************************************************************** + * Variable Declaration + ***************************************************************************/ +namespace CriMv { + extern CriError ErrorContainer; +} + +/*************************************************************************** + * Prototype Functions + ***************************************************************************/ +/*EN + * \brief CRI Movie Namespace + * \ingroup MDL_MV_BASIC + * \par + * Namespace for all CRI Movie methods, constants, and declarations + */ +/*JP + * \brief CRI Movie Namespace + * \ingroup MDL_MV_BASIC + * \par + * Namespace for all CRI Movie methods, constants, and declarations + */ +namespace CriMv { + + /*EN + * \brief Returns the version number and build information of CRI Movie + * \param none + * \return A string constant + * + * Returns the version number and build information of CRI Movie as a constant + * string, in the form + * + * "CRI Movie/{PLATFORM} {VERSION} Build:{BUILD DATE}" + */ + /*JP + * \brief CRI Moviẽo[WԍrhԂ܂B + * \return Cu񕶎 + * + */ + const CriChar8* CRIAPI GetLibraryVersionString(void); + + /*EN + * \brief Initialize the CRI Movie library + * \param err Optional error code + * + * Does one-time initialization of the CRI Movie library.
+ * This function must be successfully called before calling CriMvEasyPlayer::Create().
+ *
+ * In general, all CRI Movie APIs are available after calling CriMv::Initialize(), + * until CriMv::Finalize() is called. However, there are some methods that set options + * for the library as a whole which must be called before CriMv::Initialize():
+ *
+ * It is safe to call CriMv::Initialize() more than once, as long as your application calls + * CriMv::Finalize() once for each call to CriMv::Initialize(). Multiple calls will not + * have an effect on the library, other than to increment or decrement an internal counter. + * + * \sa CriMv::Finalize() + */ + /*JP + * \brief CRI MovieCȕ + * \param err G[iȗj + * + * CRI Movie Cu܂B
+ * CriMvEasyPlayer::Create ֐ɌĂяoĂB
+ *
+ * ƂđSĂ CRI Movie Cu֐͏AI֐Ăяo܂ł̊Ԃɂ̂ݎgp܂B
+ * A‚̐ݒ֐͏֐ɌĂяoKv̂܂B + * ڍׂ͊eݒ֐̐QƂĂB + *
+ * ֐𕡐ĂяoꍇAQڈȍ~̌Ăяoł͌Ăяo񐔂L^邾ōď͍s܂B
+ * ̏ꍇAIsɂ͓񐔂I֐ĂяoKv܂B + * ֐ƏI֐͕K΂ŌĂяo悤ɎĂB
+ * + * \sa CriMv::Finalize() + */ + void CRIAPI Initialize(CriError &err = CriMv::ErrorContainer); + + /* MEMO: + * If an application calls this function instead of CriMv::Initialize(), + * an application need to call CriMv::SetupMovieHandleWork() before CriMv::InitializeMana(). + */ + void CRIAPI InitializeMana(CriError &err = CriMv::ErrorContainer); + + /*EN + * \brief Initialize 32bit ARGB frame conversion + * + * This function initializes 32bit ARGB frame conversion.
+ * When an application uses CriMvEasyPlayer::GetFrameOnTimeAs32bitARGB(), + * please call this function after CriMv::Initialize().
+ * + * \sa CriMvEasyPlayer::GetFrameOnTimeAs32bitARGB() + */ + /*JP + * \brief 32bitARGBpt[ϊ̏ + * + * 32bitARGBpt[ϊ܂B
+ * CriMvEasyPlayer::GetFrameOnTimeAs32bitARGB() gpꍇ CRI Movie Cu + * ɕKĂяoĂB
+ * + * \sa CriMvEasyPlayer::GetFrameOnTimeAs32bitARGB() + */ + void CRIAPI InitializeFrame32bitARGB(void); + +#if defined(XPT_TGT_IPHONE) || defined(XPT_TGT_WINMO) || defined(XPT_TGT_ANDROID) || defined(XPT_TGT_CQSH2A) || defined(XPT_TGT_ACRODEA) || defined(XPT_TGT_NACL) || defined(XPT_TGT_SH7269) || defined(XPT_TGT_PC) || defined(XPT_TGT_TRGP6K) + void CRIAPI InitializeFrameRGB565(void); +#endif + + /*EN + * \brief De-initializes the CRI Movie library + * \param err Optional error code + * + * This function finalize whole CRI Movie library.
+ * An application needs to destroy all CriMvEasyPlayer handles and decoding threads before callign CriMv::Finalize().
+ *
+ * In principle, all CRI Movie library APIs are enabled after CriMv::Initialize() until CriMv::Finalize().
+ * But there are some APIs for parameter setting, which need to be called after CriMv::Finalize(). + * For details, refer to each explanations of setting APIs. + *
+ * \remarks + * CriMv::Finalize() must be called once for each call to CriMv::Initialize(). When the + * internal initialization count reaches 0, the library will be finalized. + * + * \sa CriMv::Initialize() + */ + /*JP + * \brief CRI MovieCȕI + * \param err G[iȗj + * + * CRI Movie CuI܂B
+ * ̊֐ĂяoOɁASĂ CriMvEasyPlayer nhуfR[hXbhjĂB
+ *
+ * ƂđSĂ CRI Movie Cu֐͏AI֐Ăяo܂ł̊Ԃɂ̂ݎgp܂B
+ * A‚̐ݒ֐͏I֐ɌĂяoKv̂܂B + * ڍׂ͊eݒ֐̐QƂĂB + *
+ * ֐𕡐ĂяoꍇAIsɂ͓񐔂I֐ĂяoKv܂B + * ֐ƏI֐͕K΂ŌĂяo悤ɎĂB
+ * + * \sa CriMv::Initialize() + */ + void CRIAPI Finalize(CriError &err = CriMv::ErrorContainer); + +#if !defined(XPT_TGT_EE) + /*EN + * \brief Calculates the work buffer size needed for the given number of movie handles + * \param max_num Maximum number of movie handles desired + * \param err Optional error code + * \return The necessary work buffer size, in bytes + * + * Each active movie handle requires an internal work buffer. If your application + * needs to have multiple movies open at one time, it should determine how many handles + * it needs, allocate a buffer of the size returned by this function, and pass it to + * CriMv::SetupMovieHandleWork().
+ * + * Each CriMvEasy object uses a movie handle. Alpha movie playback uses two handles. + * If you need to play aplha movies, be sure to double the number of handles requested. + * + * \remarks + * The number of movie handles must be set before calling CriMv::Initialize(). + * + * \sa CriMv::SetupMovieHandleWork() + */ + /*JP + * \brief }`nhp[Nobt@TCY̌vZ + * \param max_num őnhis[r̍Đj + * \param err G[iȗj + * \return [NTCY + * + * Ɏgp CriMvEasyPlayer nh̍ő吔𑝉ꍇɕKvȃ[Nobt@ + * TCYvZ܂B + * + * At@[rĐƃnhQ܂B + * ̃At@[rĐsꍇ́Aőnh͔{ɂĎw肵ĂB + * + * \sa CriMv::SetupMovieHandleWork() + */ + CriUint32 CRIAPI CalcMovieHandleWork(CriUint32 max_num, CriError &err = CriMv::ErrorContainer); + + /*EN + * \brief Increases the default number of available movie handles + * \param max_num Maximium number of movie handles + * \param workbuf Work buffer + * \param worksize Size of work buffer + * \param err Optional error code + * + * Call this function if your application needs to increase the maximum number of open movies + * beyond the default. Note that playing an alpha movie requires a second handle.
+ * + * The default number of movie handles depends on the platform.
+ * + * The work buffer must be allocated based on the size returned by CriMv::CalcMovieHandleWork().
+ * + * \remarks + * This function must be called before calling CriMv::Initialize(). + * + * \sa CriMv::CalcMovieHandleWork() + */ + /*JP + * \brief }`nhp[Nobt@̐ݒ + * \param max_num őnhis[r̍Đj + * \param workbuf [Nobt@AhX + * \param worksize [Nobt@TCY + * \param err G[iȗj + * + * Ɏgp CriMvEasyPlayer nh̍ő吔𑝉邽߂̃[Nobt@ݒ肵܂B + * ȂA[Nobt@w肵Ȃꍇ̃nh͋@ɂĈقȂ܂B + * + * [Nobt@̐ݒ́A CriMv::Initialize() ̌ĂяoɎsĂB + * + * \sa CriMv::CalcMovieHandleWork() + */ + void CRIAPI SetupMovieHandleWork(CriUint32 max_num, void *workbuf, CriUint32 worksize, CriError &err = CriMv::ErrorContainer); + + /*EN + * \brief Get max number of movie handles + * \param err Optional error code + * \return Max number of movie handles you set by CriMv::SetupMovieHandleWork(). + * + * Returns the maximum number of movie handles that are available to CRI Movie.
+ * + * Note that this is not necessarily equal to the number of movies that can be + * opened at a time. In general, each movie will use one handle; however, + * alpha channel movies uses two handles. + * + * \sa CriMv::SetupMovieHandleWork(), CriMv::CalcMovieHandleWork() + */ + /*JP + * \brief őnh̎擾 + * \param err G[iȗj + * \return CriMv::SetupMovieHandleWork() Őݒ肵őnh + * + * CriMv::CalcMovieHandleWork() ōőnh𑝉ꍇɁA + * ݒ肵őnh擾܂B + * + * \sa CriMv::SetupMovieHandleWork(), CriMv::CalcMovieHandleWork() + */ + CriUint32 CRIAPI GetMaxNumberOfHandles(CriError &err = CriMv::ErrorContainer); +#endif + + /* For Sofdec2 */ + CriSint32 CRIAPI CalcHandleWorkSize(CriMvHandleConfig *config, CriError &err = CriMv::ErrorContainer); + void CRIAPI SetDelayDestroySubmodules(CriBool sw); +} + +/*************************************************************************** + * CLASS + ***************************************************************************/ +/*EN + * \brief File Reading Interface Class for EasyPlayer + * \ingroup MDL_IF_READER + * \par + * You can implement your own streaming filesystem for movie playback by deriving + * from this class.
+ * + * Pass an instance of this subclass to CriMvEasyPlayer::Create().
+ * + * This class is designed for asynchronous operation. All functions are pure virtual. + * + * \sa CriMvEasyPlayer::Create() + */ +/*JP + * \brief t@Cǂݍ݃C^tF[X for EasyPlayer + * \ingroup MDL_IF_READER + * + * ̃NX`邱ƂŁAÕt@CVXegEasyPlayer + * Xg[~OД\ɂȂ܂B
+ * SĂ̊֐͏z֐ƂĒ`Ă̂ŁASĂ̊֐KĂB + * + * \sa CriMvEasyPlayer::Create() + */ +class CriMvFileReaderInterface +{ +public: + /*EN Status of an asynchronous operation */ + /*JP 񓯊Xe[^X */ + enum AsyncStatus { + ASYNC_STATUS_STOP, /*EN< No action */ + /*JP< ĂȂԁB*/ + ASYNC_STATUS_BUSY, /*EN< Currently processing */ + /*JP< */ + ASYNC_STATUS_COMPLETE, /*EN< Processing completed */ + /*JP< I */ + ASYNC_STATUS_ERROR, /*EN< An error occured */ + /*JP< G[ */ + + /* Keep enum 4bytes */ + ASYNC_STATUS_MAKE_ENUM_SINT32 = 0x7FFFFFFF + }; + /*EN Offset values for Seek() */ + /*JP V[NJnʒu */ + enum SeekOrigin { + SEEK_FROM_BEGIN, /*EN< Start of file */ + /*JP< t@C擪 */ + SEEK_FROM_CURRENT, /*EN< Current position in file */ + /*JP< t@Č݈ʒu */ + SEEK_FROM_END, /*EN< End of file */ + /*JP< t@CI[ */ + + /* Keep enum 4bytes */ + SEEK_FROM_MAKE_ENUM_SINT32 = 0x7FFFFFFF + }; + /*EN + * \brief Opens a file asynchronously + * \param fname Name of file to open + * + * Initiates a file open request, and returns immediately. + * + * To determine success or failure, call CriMvFileReaderInterface::GetOpenStatus().
+ * + * \remarks + * CRI Movie may call CriMvFileReaderInterface::Read() and CriMvFileReaderInterface::Close() + * before CriMvFileReaderInterface::GetOpenStatus() returns ASYNC_STATUS_COMPLETE. + * + * \sa CriMvFileReaderInterface::GetOpenStatus() + */ + /*JP + * \brief t@Cɂt@CI[v(A) + * \param fname t@C̕ + * + * t@CwŃt@C̃I[vvo܂B
+ * ̊֐͑Å֐ƂČĂяo܂B
+ * I[vIǂ CriMvFileReaderInterface::GetOpenStatus֐ + * Ń`FbNł悤ɂĂB
+ * CRI Movie Cu̓I[vIi CriMvFileReaderInterface::GetOpenStatus֐ + * ASYNC_STATUS_COMPLETEԂjOɁA[hAN[Y̗vĂяo”\܂B + * + * \sa CriMvFileReaderInterface::GetOpenStatus() + */ + /* pure */ virtual void Open(CriChar8 *fname)=0; + + /*EN + * \brief Closes a file asynchronously + * + * Initiates a file close request, and returns immediately.
+ * + * To determine success or failure, call CriMvFileReaderInterface::GetCloseStatus().
+ * + * \sa CriMvFileReaderInterface::GetCloseStatus() + */ + /*JP + * \brief t@C̃N[Y(A) + * + * I[vς݂̃t@C̃N[Yvo܂B
+ * ̊֐͑Å֐ƂČĂяo܂B
+ * N[YIǂ CriMvFileReaderInterface::GetCloseStatus() + * Ń`FbNł悤ɂĂB + * + * \sa CriMvFileReaderInterface::GetCloseStatus() + */ + /* pure */ virtual void Close(void)=0; + + /*EN + * \brief Reads from a file + * \param buffer Buffer to read into + * \param req_size Size of the buffer + * + * Initiates a file read request, and returns immediately.
+ * + * The buffer must be available and writable until the read request completes.
+ * + * To determine success or failure, call CriMvFileReaderInterface::GetReadStatus().
+ * + * To determine the number of bytes actually read, call CriMvFileReaderInterface::GetReadSize() + * after CriMvFileReaderInterface::GetReadStatus() has returned ASYNC_STATUS_COMPLETE. + * + * \remarks + * CRI Movie may call CriMvFileReaderInterface::Close() before + * CriMvFileReaderInterface::GetReadStatus() returns ASYNC_STATUS_COMPLETE. + * + * \sa CriMvFileReaderInterface::GetReadStatus(), CriMvFileReaderInterface::GetReadSize() + */ + /*JP + * \brief ǂݍݗviAj + * \param buffer oobt@̃|C^BǂݍݗvTCY𖞂̃obt@mۂĂKv܂B + * \param req_size ǂݍݗvTCYBPʂ̓oCgPʂłB + * + * t@C̓ǂݍݗvo܂B
+ * ̊֐͑Å֐ƂČĂяo܂B
+ * [hIǂ CriMvFileReaderInterface::GetReadStatus() + * Ń`FbNł悤ɂĂB
+ * CRI Movie Cu̓[hIi CriMvFileReaderInterface::GetReadStatus() + * ASYNC_STATUS_COMPLETEԂjOɁAN[YvĂяo”\܂B
+ * ̊֐͓ǂݍ񂾃TCYԂ܂B
+ * ǂݍݍς݃TCÝA CriMvFileReaderInterface::GetReadStatus() ASYNC_STATUS_COMPLETE + * ԂƂ CriMvFileReaderInterface::GetReadSize()ŕԂ悤ɎĂB + * + * \sa CriMvFileReaderInterface::GetReadStatus(), CriMvFileReaderInterface::GetReadSize() + */ + /* pure */ virtual void Read(CriUint8 *buffer, CriSint64 req_size)=0; + + /*EN + * \brief Gets asynchronous status of a call to CriMvFileReaderInterface::Open() + * + * \return Status of the call + * + * While the Open() call is in process, this will return ASYNC_STATUS_BUSY.
+ * If the call fails, this will return ASYNC_STATUS_ERROR.
+ * On success, this will return ASYNC_STATUS_COMPLETE.
+ * + * \sa CriMvFileReaderInterface::Open() + */ + /*JP + * \brief I[vR}h̏Ԏ擾 + * \return I[vR}h̏ԁB + * + * CriMvFileReaderInterface::Open֐̏Ԃ擾܂B + * + * \sa CriMvFileReaderInterface::Open() + */ + /* pure */ virtual CriMvFileReaderInterface::AsyncStatus GetOpenStatus(void)=0; + + /*EN + * \brief Gets asynchronous status of a call to CriMvFileReaderInterface::Close() + * + * \return Status of the call + * + * While the Close() call is in process, this will return ASYNC_STATUS_BUSY.
+ * If the call fails, this will return ASYNC_STATUS_ERROR.
+ * On success, this will return ASYNC_STATUS_COMPLETE.
+ * + * \sa CriMvFileReaderInterface::Close() + */ + /*JP + * \brief N[YR}h̏Ԏ擾 + * \return N[YR}h̏ԁB + * + * CriMvFileReaderInterface::Close֐̏Ԃ擾܂B + * + * \sa CriMvFileReaderInterface::Close() + */ + /* pure */ virtual CriMvFileReaderInterface::AsyncStatus GetCloseStatus(void)=0; + + /*EN + * \brief Gets asynchronous status of a call to CriMvFileReaderInterface::Read() + * + * \return Status of the call + * + * While the Read() call is in process, this will return ASYNC_STATUS_BUSY.
+ * If the call fails, this will return ASYNC_STATUS_ERROR.
+ * On success, this will return ASYNC_STATUS_COMPLETE.
+ * + * \sa CriMvFileReaderInterface::Read() + */ + /*JP + * \brief [hR}h̏Ԏ擾 + * \return [hR}h̏ԁB + * + * CriMvFileReaderInterface::Read֐̏Ԃ擾܂B + * + * \sa CriMvFileReaderInterface::Read() + */ + /* pure */ virtual CriMvFileReaderInterface::AsyncStatus GetReadStatus(void)=0; + + /*EN + * \brief Gets the number of bytes read by a successful call to CriMvFileReaderInterface::Read() + * + * \return Number of bytes read + * + * Once CriMvFileReaderInterface::GetReadStatus() returns ASYNC_STATUS_COMPLETE, this + * function can be called to determine the number of bytes read by + * CriMvFileReaderInterface::Read().
+ * + * If no call to Read() has been made, this function will return 0.
+ * + * If called multiple times after completing the read, the same value will be returned each time. + * + * \sa CriMvFileReaderInterface::Read(), CriMvFileReaderInterface::GetReadStatus() + */ + /*JP + * \brief Oǂݍݗvɑ΂ǂݍ݊TCY + * \return ǂݍ݊TCYBPʂByteB + * + * O̓ǂݍݗvɑ΂ēǂݍ݊TCYԂ܂B + * ܂ǂݍ݂PxvĂȂꍇ͂OԂ܂B + * ǂݍ݊ɌJԂ̊֐Ăяoꂽꍇ́AׂēlԂ܂B + * + * \sa CriMvFileReaderInterface::Read(), CriMvFileReaderInterface::GetReadStatus() + */ + /* pure */ virtual CriSint64 GetReadSize(void)=0; + + /*EN + * \brief Seeks to a new position in the file + * + * \param size Number of bytes to seek relative to \a offset + * \param offset Starting position of seek + * \return The offset, in bytes, from the previous file position. + * + * If \a offset is SEEK_FROM_BEGIN, seeking will start from the beginning of the file.
+ * If \a offset is SEEK_FROM_CURRENT, seeking will start from the current file position.
+ * If \a offset is SEEK_FROM_END, seeking will start from the end of the file.
+ * + * \sa CriMvFileReaderInterface::SeekOrigin + */ + /*JP + * \brief V[N + * \param size V[NTCY + * \param offset V[N̊Jnʒu + * \return ۂɃV[NBBytePʁB + * + * \sa CriMvFileReaderInterface::SeekOrigin + * + */ + /* pure */ virtual CriSint64 Seek(CriSint64 size, CriMvFileReaderInterface::SeekOrigin offset)=0; + + /*EN + * \brief Gets the file size + * + * \return File size, in bytes + * + * This function can safely be called once CriMvFileReaderInterface::Open() has completed + * successfully. + * + * \sa CriMvFileReaderInterface::Open(), CriMvFileReaderInterface::GetOpenStatus() + */ + /*JP + * \brief t@CTCY̎擾 + * \return t@CTCY[byte]. + * + * ̊֐̓t@CI[v̏IɌĂяo܂B + * + * \sa CriMvFileReaderInterface::Open(), CriMvFileReaderInterface::GetOpenStatus() + */ + /* pure */ virtual CriSint64 GetFileSize(void)=0; + +protected: + virtual ~CriMvFileReaderInterface(void) {} +}; + +/*EN + * \brief Sound Interface Class for EasyPlayer + * \ingroup MDL_IF_SOUND + * + * \par + * A class derived from CriMvSoundInterface is required in order to play sound in CRI Movie. + * Pass an instance of this subclass to CriMvEasyPlayer::Create().
+ * + * If you do not need audio output, you can pass NULL instead. However, if you do, + * you can not use a movie timer of type MVEASY_TIMER_AUDIO. See CriMvEasyPlayer::SetMasterTimer() + * for more details.
+ * + * Sound data must be provided in either 32 or 16 bit PCM format. + * + * All functions are pure virtual. + * + * \sa CriMvEasyPlayer::Create(), CriMvEasyPlayer::SetMasterTimer(), CriMvEasyPlayer::TimerType + */ +/*JP + * \brief TEho̓C^tF[X + * \ingroup MDL_IF_SOUND + * + * \sa CriMvEasyPlayer::Create(), CriMvEasyPlayer::SetMasterTimer(), CriMvEasyPlayer::TimerType + */ +class CriMvSoundInterface +{ +public: + /*EN + * \brief The status of the Sound Module + * + * This is the return value of CriMvSoundInterface::GetStatus().
+ * + * After CriMvSoundInterface::Start() is called, the state transitions to MVEASY_SOUND_STATUS_EXEC.
+ * While the state is MVEASY_SOUND_STATUS_EXEC, the sound module calls the callback function + * to retrieve sound data as needed.
+ * When the EasyPlayer is stopped, or transits to MVEASY_STATUS_PLAYEND, + * CRI Movie will call CriMvSoundInterface::Stop(). Then, CRI Movie waits for + * CriMvSoundInterface::GetStatus() to return MVEASY_SOUND_STATUS_STOP, + * and calls CriMvSoundInterface::DestroyOutput(). + * + * \sa CriMvSoundInterface::GetStatus(), CriMvSoundInterface::Start(), + * CriMvSoundInterface::Stop(), CriMvSoundInterface::DestroyOutput() + */ + /*JP + * \brief TEhW[̏ + * + * TEhW[̏Ԃ\񋓌^łB
+ * CriMvEasyPlayer::GetStatus() ̊֐lłB
+ * CriMvSoundInterface::Start() ĂяoMVEASY_SOUND_STATUS_EXECԂɂȂ܂B
+ * MVEASY_SOUND_STATUS_EXECԂ̊Ԃ́ATEho̓W[̓R[obN֐Ăяo܂B
+ * CRI Movie Cu͍ĐI܂͍Đ~w󂯂ꍇA܂ CriMvSoundInterface::Stop()Ăяo܂B
+ * ̌ASTOPԂɂȂ̂҂Ă CriMvSoundInterface::DestroyOutput()Ăяo܂B + * + * \sa CriMvSoundInterface::GetStatus(), CriMvSoundInterface::Start(), + * CriMvSoundInterface::Stop(), CriMvSoundInterface::DestroyOutput() + */ + enum Status { + MVEASY_SOUND_STATUS_STOP, /*EN< No sound processing is happening. */ + /*JP< CRI Movie ̃TEho͂ĂȂ */ + MVEASY_SOUND_STATUS_EXEC, /*EN< Sound data is being retrieved and processed. */ + /*JP< CRI Movie ̃TEho͒ */ + MVEASY_SOUND_STATUS_ERROR, /*EN< An error has occurred. */ + /*JP< G[ */ + + /* Keep enum 4bytes */ + MVEASY_SOUND_STATUS_MAKE_ENUM_SINT32 = 0x7FFFFFFF + }; + + /*EN + * \brief PCM audio data format + * + * CRI Movie only operates on PCM encoded data. Two formats are supported: 32 bit floating + * point values, and 16 bit integer values. + * + * Return one of these values from CriMvSoundInterface::GetPcmFormat(). + * According to the returned format, CRI Movie calls a SetCallback for the specified PCM format. + * + * \sa CriMvSoundInterface::GetPcmFormat(), CriMvSoundInterface::SetCallbackGetFloat32PcmData(), + * CriMvSoundInterface::SetCallbackGetSint16PcmData() + */ + /*JP + * \brief PCMf[^tH[}bg + * + * PCM̏o̓tH[}bgPcmFormat^Œ`ꂽꂩłȂ΂܂B
+ * EasyPlayer CriMvSoundInterface::GetPcmFormat()Ŏ擾łf[^^̂ݎgp܂B
+ * AvP[V͂̃NX̑SĂ̊֐Ȃ΂Ȃ̂ŁAgȂtH[}bg + * ̃R[obNo^֐̓J֐ƂĎĂB + * + * \sa CriMvSoundInterface::GetPcmFormat(), CriMvSoundInterface::SetCallbackGetFloat32PcmData(), + * CriMvSoundInterface::SetCallbackGetSint16PcmData() + */ + enum PcmFormat { + MVEASY_PCM_FLOAT32, /*EN< PCM data is in 32 bit floating point format. */ + /*JP< 32bit ^PCMtH[}bg */ + MVEASY_PCM_SINT16, /*EN< PCM data is in 16 bit integer format. */ + /*JP< 16bit ^PCMtH[}bg */ + + /* Keep enum 4bytes */ + MVEASY_PCM_MAKE_ENUM_SINT32 = 0x7FFFFFFF + }; + + /*EN + * \brief Creates a sound output module + * \param heap Handle to a CriHeap object + * \param channel Number of sound channels (1 = monaural, 2 = stereo, 6 = 5.1ch) + * \param samplerate Sample rate of audio data (ex. 48000 = 48k) + * \return TRUE if the sound module was created successfully + * \return FALSE if there was an error + * + * Creates a CRI Movie sound output module and prepares it for use. Memory for the module + * is taken from the provided CriHeap object.
+ * + * CRI Movie calls this method once it has determined that a movie has an active audio track + * and has analyzed the number of channels (mono, stereo, 5.1ch, etc.) and the sample rate. + * + */ + /*JP + * \brief TEho͂̍쐬 + * \param heap nh + * \param channel o͂TEh̃`l (1=monaural, 2=stereo, 6=5.1ch) + * \param samplerate TvO[g (ex. 48k = 48000) + * \return 쐬ʁB̏ꍇTRUEAs̏ꍇFALSEԂ܂B + * + * TEho͂쐬܂B
+ * ̊֐ CRI Movie ĐTEh肵ƂɁÃTEh̃`l + * TvO[gƂĎs܂B + * + */ + /* pure */ virtual CriBool CreateOutput(CriHeap heap, CriUint32 channel, CriUint32 samplerate)=0; + + /*EN + * \brief Destroys the sound output module + * + * Deletes the sound output module that was created by + * CriMvSoundInterface::CreateOutput().
+ * + * CRI Movie calls this method once CriMvSoundInterface::GetStatus() returns MVEASY_SOUND_STATUS_STOP. + * + */ + /*JP + * \brief TEho͂̔j + * + * TEho͂j܂B
+ * ̊֐̓TEho͂ MVEASY_SOUND_STATUS_STOP ԂɂȂɌĂяo܂B + * + */ + /* pure */ virtual void DestroyOutput(void)=0; + + /*EN + * \brief Gets the PCM format of audio data + * \return The type of PCM format supported by this CriMvSoundInterface instance + * + * CRI Movie supports audio data in one of two PCM formats: 32 bit floating point (MVEASY_PCM_FLOAT32) + * or 16 bit integer (MVEASY_PCM_SINT16). EasyPlayer uses the return value from this method to + * determine which format is being used, and will call the appropriate callback function to retrieve + * data samples. + * + * \sa CriMvSoundInterface::PcmFormat + */ + /*JP + * \brief PCMf[^tH[}bg̎擾 + * \return CriMvSoundInterface gpPCMtH[}bgԂ܂B + * + * EasyPlayer͂̊֐ɂāAo͂PCMtH[}bg𔻒f܂B + * + * \sa CriMvSoundInterface::PcmFormat + */ + /* pure */ virtual PcmFormat GetPcmFormat(void)=0; + + /*EN + * \brief Sets the callback function for retrieving 32 bit floating point PCM sound samples + * \param func Function that is called when CriMvSoundInterface gets PCM data (32bit float) + * \param obj Pointer to user-specifed data, passed as the first argument to the callback + * + * Sets a function that CriMvSoundInterface will call when it needs audio data in 32 bit floating point + * PCM format. This callback function takes 4 arguments:
+ * + * - \a obj: The user-specified \a obj parameter passed to SetCallbackGetFloat32PcmData().
+ * - \a nch: The number of audio channels. Mono is 1, stereo is 2, 5.1 channel is 6.
+ * - \a pcmbuf: An array of buffers to hold the returned PCM data. There must be one element of + * this array for each channel.
+ * - \a req_nsmpl: The number of samples requested. Each buffer must be large enough to hold this + * many samples (i.e. \a nch * \a req_nsmpl). + * + * \remarks + * The maximum number of channels is CRIMV_PCM_BUFFER_MAX + * + * \sa CriMvSoundInterface::SetCallbackGetSint16PcmData() + */ + /*JP + * \brief 32bit`PCMf[^擾R[obN֐̓o^ + * \param func CriMvSoundInterface PCMf[^vۂɌĂтR[obN֐ + * \param obj R[obN֐sۂɑɎw肷IuWFNgϐ + * + * CriMvSoundInterface EasyPlayerPCMf[^vۂɌĂяoR[obN֐o^܂B + * R[obN֐͂S‚̈Ă܂B
+ * - "obj" ̓R[obN֐ŎgpIuWFNgłB + * R[obN֐Ăяoۂ́A֐o^Ɏw肳ꂽobjK̈ɓĂB
+ * - "nch" CriMvSoundInterface vI[fBĨ`lłBmȂ1BXeIȂ2B5.1chȂ6ƂȂ܂B
+ * - "pcmbuf" PCMf[^i[邽߂̃obt@|C^złB
+ * obt@̎̂ CriMvSoundInterface ŏĂBobt@̐"nch"ƓłȂ΂܂B
+ * - "req_nsmpl" CriMvSoundInterface vPCMf[^̍őTvłB
+ * "pcmbuf"Ŏw肵eobt@̂ɂ́ÃTv܂ĂvȂ̗̈KĂB
+ * + * o^ꂽR[obN֐Ăяo^C~O CriMvSoundInterface ̔CӂƂȂ܂B + * + * \sa CriMvSoundInterface::SetCallbackGetSint16PcmData() + */ + /* pure */ virtual void SetCallbackGetFloat32PcmData(CriUint32 (*func)(void *obj, CriUint32 nch, CriFloat32 *pcmbuf[], CriUint32 req_nsmpl), void *obj)=0; + + /*EN + * \brief Sets the callback function for retrieving 16 bit integer PCM sound samples + * \param func Function that will be called when 16 bit integer PCM data is needed + * \param obj Pointer to user-specifed data, passed as the first argument to the callback + * + * Sets a function that CriMvSoundInterface will call when it needs audio data in 16 bit integer + * PCM format. This callback function takes 4 arguments:
+ * + * - \a obj: The user-specified \a obj parameter passed to SetCallbackGetSint16PcmData().
+ * - \a nch: The number of audio channels. Mono is 1, stereo is 2, 5.1 channel is 6.
+ * - \a pcmbuf: An array of buffers to hold the returned PCM data. There must be one element of + * this array for each channel.
+ * - \a req_nsmpl: The number of samples requested. Each buffer must be large enough to hold this + * many samples (i.e. \a nch * \a req_nsmpl). + * + * \remarks + * The maximum number of channels is CRIMV_PCM_BUFFER_MAX (currently 8) + * + * \sa CriMvSoundInterface::SetCallbackGetFloat32PcmData() + */ + /*JP + * \brief 16bit`PCMf[^擾R[obN֐̓o^ + * \param func CriMvSoundInterface PCMf[^vۂɌĂтR[obN֐ + * \param obj R[obN֐sۂɑɎw肷IuWFNgϐ + * + * PCMtH[}bgႤȊÓA CriMvSoundInterface::SetCallbackGetFloat32PcmData() ƓłB + * + * \sa CriMvSoundInterface::SetCallbackGetFloat32PcmData() + */ + /* pure */ virtual void SetCallbackGetSint16PcmData(CriUint32 (*func)(void *obj, CriUint32 nch, CriSint16 *pcmbuf[], CriUint32 req_nsmpl), void *obj)=0; + + /*EN + * \brief Starts sound output + * + * CRI Movie will call this method when it needs to start playing sound. The PCM data callback function + * has to be called after this function until movie playback is finished.
+ * + * Your sound module should begin incrementing its playback time when this method is called. + * + * \remarks + * On success, this should set the status to CriMvSoundInterface::MVEASY_SOUND_STATUS_EXEC. + */ + /*JP + * \brief TEho͂̊Jn + * + * TEho͂Jn܂BPCMf[^擾pR[obN֐́A{֐̌ďoォsĂB + */ + /* pure */ virtual void Start(void)=0; + + /*EN + * \brief Stops sound output + * + * CRI Movie will call this when the movie playback stops, or the status changes to MVEASY_STATUS_PLAYEND.
+ * + * When EasyPlayer wants to pause and restart playback, it will call CriMvSoundInterface::Pause() + * instead of this method.
+ * + * Your sound module should set its playback time to 0 when this method is called. + * + * \remarks + * This should set the status to CriMvSoundInterface::MVEASY_SOUND_STATUS_STOP. + * + * \sa CriMvSoundInterface::Pause(), CriMvSoundInterface::Start() + */ + /*JP + * \brief TEho͂̒~ + * + * TEho͂~܂BĊJł悤ɂKv͂܂B
+ * EasyPlayerĊJsꍇ́A{֐ł͂ȂA CriMvSoundInterface::Pause()Ăяo܂B
+ * CriMvSoundInterface::Stop() ďóAR[obN֐Ă΂Ȃ悤ɎĂB + * + * \sa CriMvSoundInterface::Pause(), CriMvSoundInterface::Stop() + */ + /* pure */ virtual void Stop(void)=0; + + /*EN + * \brief Gets status of sound module + * \return The module status + * + * This must return one of the enumerated values in CriMvSoundInterface::Status.
+ * + * While this method returns CriMvSoundInterface::MVEASY_SOUND_STATUS_EXEC, EasyPlayer will call the + * PCM data callback.
+ * When a movie has finished playing and this method returns CriMvSoundInterface::MVEASY_SOUND_STATUS_STOP, + * EasyPlayer will call CriMvSoundInterface::DestroyOutput(). + * + * \sa CriMvSoundInterface::Status + */ + /*JP + * \brief TEhW[̏Ԏ擾 + * + * TEhW[̏Ԃ擾܂B + * + * \sa CriMvSoundInterface::Status + */ + /* pure */ virtual Status GetStatus(void)=0; + + /*EN + * \brief Pauses or resumes sound output + * \param sw Pause or resume playback. + * + * If \a sw is 1 (ON), output will be paused.
+ * If \a sw is 0 (OFF), output will be resumed.
+ * + * Temporarily pauses or resumes sound output.
+ * + * When you pause sound output, you must pause your playback timer as well. + */ + /*JP + * \brief TEho͂̈ꎞ~܂͍ĊJ + * \param sw |[YXCb`B|[YON̏ꍇ1A|[YOFF(W[)̏ꍇ0w肵܂B + * + * {֐͈̓Ɉˑ܂B
+ * sw ON(1)ȂAꎞ~B sw OFF(0)ȂTEho͍ĊJłB + */ + /* pure */ virtual void Pause(CriBool sw)=0; + + /*EN + * \brief Gets the time, in seconds, that sound has been playing + * \param count Playback time counter + * \param unit Counter increment per second + * + * CRI Movie calls this method periodically for some damn reason.
+ *
+ * The time, in seconds, is specified by \a count / \a unit.
+ * + * For example, if \a count was 500 and \a unit was 1000, that would be 0.5 seconds.
+ * + * \remarks + * Before Start() is called, and after Stop() is called, \a count should be 0. + */ + /*JP + * \brief Đ̎擾 + * \param count ^C}JEg + * \param unit Pb̃^C}JEglBcount unit ŕbPʂ̎ƂȂ܂B + * + * ^C}擾܂Bcountunit̓‚̕ϐŕ\܂B
+ * count unit ŕbPʂ̎ƂȂ悤ȒlԂ܂B
+ * ĐJnOi CriMvSoundInterface::Start()ĂяoOj + * Đ~i CriMvSoundInterface::Stop()Ăяoj́AOi^C}JEgOjԂ܂B + */ + /* pure */ virtual void GetTime(CriUint64 &count, CriUint64 &unit)=0; // sec = count / unit. + +protected: + virtual ~CriMvSoundInterface(void) {} +}; + +/*EN + * \brief System Timer Interface Class for EasyPlayer + * \ingroup MDL_IF_TIMER + * + * If you want to synchronize video frames with something other than the audio track, or if you + * need to play a movie that does not have an audio track, you will need to pass an instance of + * a class derived from CriMvSystemTimerInterface to CriMvEasyPlayer::Create().
+ * + * If you do not need any special timer facilities, you can pass NULL to CriMvEasyPlayer::Create() instead.
+ * + * All functions are pure virtual. + * + * \sa CriMvEasyPlayer::Create(), CriMvEasyPlayer::SyncMasterTimer() + */ +/*JP + * \brief VXe^C}[C^tF[X for EasyPlayer + * \ingroup MDL_IF_TIMER + * + * VXe^C}[͉[rĐɁArfIt[̑o^C~O𒲐邽߂Ɏgp܂B
+ * ̃NX`邱ƂŁAÕ^C}VXegEasyPlayer̃Xg[~OД\ɂȂ܂B
+ * SĂ̊֐͏z֐ƂĒ`Ă̂ŁASĂ̊֐KĂB + * + * \sa CriMvEasyPlayer::Create(), CriMvEasyPlayer::SyncMasterTimer() + */ +class CriMvSystemTimerInterface +{ +public: + /*EN + * \brief Starts timer and resets it to 0 + * + * When this method is called, your internal counter should initialize itself to 0 and start + * normal operation. + */ + /*JP + * \brief ^C}Jn + * + * ^C}̃JEgJn܂B̊֐Ă΂ꂽOƂȂ܂B + */ + /* pure */ virtual void Start(void)=0; + + /*EN + * \brief Stops the timer and resets it to 0 + * + * When this method is called, your internal counter should stop incrementing, and re-initialize + * itself to 0. After this method has been called, CriMvSystemTimerInterface::GetTime() must + * return a time of 0 seconds. + */ + /*JP + * \brief ^C}~ + * + * ^C}̃JEg~܂B̊֐Ă΂ꂽƂɁÃ^C}ĊJ邱Ƃ͂܂B + */ + /* pure */ virtual void Stop(void)=0; + + /*EN + * \brief Pauses or resumes the timer + * + * \param sw Pause or resume timer operation. + * + * If \a sw is 1 (ON), the timer will be paused.
+ * If \a sw is 0 (OFF), the timer will be resumed.
+ * + * Temporarily pauses or resumes the timer.
+ * + * When you pause the timer, you must maintain the previous value of the counter. + */ + /*JP + * \brief ^C}̈ꎞ~܂͍ĊJ + * \param sw |[YXCb`BON(1)Ȃꎞ~AOFF(0)ȂĊJB + * + * {֐͈̓Ɉˑ܂B
+ * sw ON(1)ȂAꎞ~B sw OFF(0)Ȃ^C}JEgĊJłB + */ + /* pure */ virtual void Pause(CriBool sw)=0; + + /*EN + * \brief Gets the time, in seconds, that the timer has been running + * + * \param count Timer counter + * \param unit Counter increment per second + * + * CRI Movie calls this method periodically to synchronize video playback with the + * movie's internal framerate.
+ *
+ * The time, in seconds, is specified by \a count / \a unit.
+ * + * For example, if \a count was 500 and \a unit was 1000, that would be 0.5 seconds.
+ * + * \remarks + * Before Start() is called, and after Stop() is called, \a count should be 0. + */ + /*JP + * \brief oߎ̎擾 + * \param count ^C}JEg + * \param unit Pb̃^C}JEglBcount unit ŕbPʂ̎ƂȂ܂B + * + * ^C}擾܂Bcountunit̓‚̕ϐŕ\܂B
+ * count unit ŕbPʂ̎ƂȂ悤ȒlԂ܂B
+ * ĐJnOi CriMvSystemTimerInterface::Start()ĂяoOj + * Đ~i CriMvSystemTimerInterface::Stop()Ăяoj́AOi^C}JEgOjԂ܂B + */ + /* pure */ virtual void GetTime(CriUint64 &count, CriUint64 &unit)=0; + +protected: + virtual ~CriMvSystemTimerInterface(void) {} +}; + + +/*EN + * \brief EasyPlayer Interface class for CRI Movie + * \ingroup MDL_EASY_PLAYER + */ +/*JP + * \brief EasyPlayerC^tF[X + * \ingroup MDL_EASY_PLAYER + */ +class CriMvEasyPlayer : public CriAllocator +{ +public: + /*EN + * \brief The possible states an EasyPlayer handle can be in. + * + * An EasyPlayer handle takes on various states, depending on where it is in the decoding process. + * You can check the status of a valid EasyPlayer handle at any time by calling CriMvEasyPlayer::GetStatus(). + * + * An EasyPlayer handle is created in the MVEASY_STATUS_STOP state. During movie playback, the status + * transitions through various states from MVEASY_STATUS_STOP to MVEASY_STATUS_PLAYEND. + * + * An application does not need to check all states. At a minimum, it only needs to check for + * MVEASY_STATUS_STOP, MVEASY_STATUS_PLAYING, MVEASY_STATUS_PLAYEND, + * and MVEASY_STATUS_ERROR. + * + * If an application calls CriMvEasyPlayer::DecodeHeader(), the status of the EasyPlayer handle will change to + * MVEASY_STATUS_WAIT_PREP when CRI Movie has finished analyzing the movie information. The EasyPlayer + * handle will remain in this state until the application calls CriMvEasyPlayer::Prepare() or + * CriMvEasyPlayer::Start(). Once the state has changed to MVEASY_STATUS_WAIT_PREP, information + * about the movie can be retrieved by calling CriMvEasyPlayer::GetMovieInfo(). + * + * If an application calls CriMvEasyPlayer::Prepare(), the EasyPlayer handle status will change to + * MVEASY_STATUS_READY once CRI Movie has finished buffering enough input and decoded output for playback. + * The handle will remain in this state until CriMvEasyPlayer::Start() is called. This allows the application + * to better control playback timing, since a movie can immediately start playing. + * + * Once CriMvEasyPlayer::Start() is called and the movie is actively playing, the status will alternate + * between MVEASY_STATUS_PLAYING and MVEASY_STATUS_PREP, as CRI Movie plays back frames and decodes + * new ones. + * + * When the movie has finished playing normally, the status of the EasyPlayer handle will automatically change + * to MVEASY_STATUS_PLAYEND. If the movie is in looping mode, however, once the movie reaches the + * end, it will start playing from the beginning and the status will not change to MVEASY_STATUS_PLAYEND. + * + * When CriMvEasyPlayer::Stop() is called, the status of the handle will change to MVEASY_STATUS_STOP + * once it has finished any decoding and playback that is in progress. This does not happen immediately, + * but will take a few cycles. + * + * If there are any problems during playback, for instance insufficient memory or invalid input data, the + * status will change to MVEASY_STATUS_ERROR. When the handle is in state MVEASY_STATUS_ERROR, + * the application must call CriMvEasyPlayer::Stop() and wait until the state changes to MVEASY_STATUS_STOP + * before doing anything else with the handle. + * + * Once the state is MVEASY_STATUS_STOP or MVEASY_STATUS_PLAYEND, the handle can be deleted by + * calling CriMvEasyPlayer::Destroy(). + * + * \attention + * As of CRI Movie version 2.00, the handling of the MVEASY_STATUS_ERROR state has changed. Previously, + * a handle could be destroyed when it was in the MVEASY_STATUS_ERROR state. Now, an application + * must call CriMvEasyPlayer::Stop() and wait for the MVEASY_STATUS_STOP state before destroying + * the handle. + * + * \sa CriMvEasyPlayer::GetStatus(), CriMvEasyPlayer::Start(), CriMvEasyPlayer::DecodeHeader(), + * CriMvEasyPlayer::Prepare(), CriMvEasyPlayer::GetMovieInfo(), CriMvEasyPlayer::Stop(), + * CriMvEasyPlayer::Destroy() + */ + /*JP + * \brief EasyPlayernh + * + * EasyPlayer ̃nhԂłB + * nhԂ CriMvEasyPlayer::GetStatus() ł‚ł擾邱Ƃo܂B
+ * nh쐬 MVEASY_STATUS_STOP ԂłB + * + * nhԂ MVEASY_STATUS_STOP MVEASY_STATUS_PLAYEND ܂ŏɑJڂĂ܂B
+ * AvP[V[rĐɂāAK̑SĂ̏Ԃ`FbNKv͂܂B
+ * ŒAMVEASY_STATUS_STOP, MVEASY_STATUS_PLAYING, MVEASY_STATUS_PLAYEND, MVEASY_STATUS_ERROR + * `FbN΁A[r̍ĐsƂł܂B + * + * EasyPlayer nh쐬A[r̉𑜓xȂǂɊm肵Ăꍇ́AAvP[V + * CriMvEasyPlayer::Start() 𒼐ڌĂяoƂł܂B̏ꍇAnhԂ͎I + * MVEASY_STATUS_PLAYEND ܂őJڂĂ܂B + * + * ŏ CriMvEasyPlayer::DecodeHeader() Ăяoꍇ́Awb_͂IƃnhԂ + * MVEASY_STATUS_WAIT_PREP ƂȂAAvP[V CriMvEasyPlayer::Prepare() ܂ + * CriMvEasyPlayer::Start() Ă΂܂őҋ@܂B + * + * MVEASY_STATUS_WAIT_PREPԈȍ~A CriMvEasyPlayer::GetMovieInfo() Ń[r擾邱Ƃł܂B
+ * CriMvEasyPlayer::Prepare() Ăяoꍇ́Awb_͂уf[^̃obt@OIƁA + * nhԂ MVEASY_STATUS_READY ƂȂAAvP[V CriMvEasyPlayer::Start() + * Ă΂܂őҋ@܂BɂčĐJñ^C~O𒲐邱Ƃł܂B + * + * ĐIƎI MVEASY_STATUS_PLAYEND ɂȂ܂B + * + * CriMvEasyPlayer::Stop() Ăяoꍇ́AfR[_̒~IƂ MVEASY_STATUS_STOP + * ԂɂȂ܂B CriMvEasyPlayer::Stop() Iɒ~ԂɂȂƂ͌܂B + * + * sf[^G[Ȃlj炩̖肪ꍇ MVEASY_STATUS_ERROR ԂƂȂ܂B
+ * MVEASY_STATUS_ERROR ԂɂȂꍇ CriMvEasyPlayer::Stop() ĂяoănhԂ + * MVEASY_STATUS_STOP ԂɑJڂĂB
+ * + * CriMvEasyPlayer::Destroy() MVEASY_STATUS_STOP, MVEASY_STATUS_PLAYEND + * ꂩ̏Ԃ̎̂݌ĂяoƂł܂B + * + * \attention + * CRI Movie Ver.2.00 MVEASY_STATUS_ERROR Ԃɂ‚Ă̎dlύXɂȂ܂B
+ * MVEASY_STATUS_ERROR ԂŃnhjoȂȂA CriMvEasyPlay::Stop() ĂяoKv܂B + * + * \sa CriMvEasyPlayer::GetStatus(), CriMvEasyPlayer::Start(), CriMvEasyPlayer::DecodeHeader(), + * CriMvEasyPlayer::Prepare(), CriMvEasyPlayer::GetMovieInfo(), CriMvEasyPlayer::Stop(), + * CriMvEasyPlayer::Destroy() + */ + enum Status { + MVEASY_STATUS_STOP, /*EN< Standstill. No processing is happening. + * EasyPlayer handles are created in this state. */ + /*JP< ~ */ + MVEASY_STATUS_DECHDR, /*EN< The EasyPlayer handle is now parsing the movie header, + * including information about the width and height of the video stream. */ + /*JP< wb_͒ */ + MVEASY_STATUS_WAIT_PREP, /*EN< The EasyPlayer handle is a waiting for the work buffer to be allocated. */ + /*JP< obt@OJnҋ@ */ + MVEASY_STATUS_PREP, /*EN< The EasyPlayer handle is now buffering video and audio data. */ + /*JP< Đ */ + MVEASY_STATUS_READY, /*EN< Ready to start playback. */ + /*JP< Đҋ@ */ + MVEASY_STATUS_PLAYING, /*EN< The decoders are currently decoding and playing output. */ + /*JP< Đ */ + MVEASY_STATUS_PLAYEND, /*EN< The end of the movie has been reached. */ + /*JP< ĐI */ + MVEASY_STATUS_ERROR, /*EN< An error has occurred. */ + /*JP< G[ */ + + /* Keep enum 4bytes */ + MVEASY_STATUS_MAKE_ENUM_SINT32 = 0x7FFFFFFF + }; + + /*EN + * \brief Supported timer types; used to synchronize video frames. + */ + /*JP + * \brief ^C} + */ + enum TimerType { + MVEASY_TIMER_NONE, /*EN< No synchronization. The output is available as soon as + * each frame is decoded. */ + /*JP< rfIt[͎܂BfR[hIt[ + * ͂Ɏ擾邱Ƃł܂B */ + MVEASY_TIMER_SYSTEM, /*EN< Video frames synchronize to the system timer.
+ * You must provide an instance of CriMvSystemTimerInterface to + * CriMvEasyPlayer::Create(). */ + /*JP< rfIt[̓VXeɓ܂BVXe̓AvP[V + * CriMvSystemTimerInterface ƂCriMvEasynhɐݒ肷Kv܂B */ + MVEASY_TIMER_AUDIO, /*EN< Video frames synchronize with the movie's audio data.
+ * You must provide an instance of CriMvSoundInterface to CriMvEasyPlayer::Create().
+ * If the movie does not have audio, video frames will synchronize with the system timer. */ + /*JP< rfIt[̓[r̃I[fBIɓ܂B + * AvP[V GetTime֐܂ CriMvSoundInterface CriMvEasy + * nhɐݒ肷Kv܂B[rf[^ɃI[fBI܂܂ + * Ȃꍇ́ArfI̓VXeɓ܂B */ + + /* Keep enum 4bytes */ + MVEASY_TIMER_MAKE_ENUM_SINT32 = 0x7FFFFFFF + }; + + /*EN + * \ingroup MODULE_INIT + * + * \brief Creates an EasyPlayer handle + * + * \param heap Handle to a CriHeap object + * \param freader File input interface + * \param stimer System timer interface + * \param sound Sound module interface + * \param err Optional error code + * + * \return A valid CriMvEasyPlayer handle, or NULL if the handle cannot be allocated + * + * Creates and initialize a new EasyPlayer handle. Its status is initially MVEASY_STATUS_STOP. + * Memory for the handle is allocated from the provided CriHeap object. + * + * If memory allocation fails, this function will return NULL. Be sure to initialize and create + * your heap with criHeap_Initialize() and criHeap_Create() before calling this function. + * + * \remarks + * CriMv::Initialize() must be called before calling this function. + * + */ + /*JP + * \ingroup MODULE_INIT + * \brief EasyPlayernh̍쐬 + * \param heap CriHeapnh + * \param freader t@Cǂݍ݃C^tF[X + * \param stimer VXe^C}C^tF[X + * \param sound TEhC^tF[X + * \param err G[ + * \return CriMvEasynhԂ܂BG[ꍇ́ANULLԂ܂B + * + * {֐ CriMv::Initialize() ĂяoɎsĂB
+ * nh쐬̓nhԂMVEASY_STATUS_STOPƂȂ܂B
+ * nhmۂɕKvȃ͑SāAœnꂽ CriHeap gĊmۂ܂B
+ * sȂǂŃG[ꍇ́A{֐NULLԂ܂B + * + */ + static CriMvEasyPlayer* CRIAPI Create(CriHeap heap, + CriMvFileReaderInterface *freader, + CriMvSystemTimerInterface *stimer, + CriMvSoundInterface *sound, + CriError &err=CriMv::ErrorContainer); + /*EN + * \ingroup MODULE_INIT + * \brief Destroy a handle + * \param err Optional error code + * + * \ingroup MODULE_INIT + * + * \brief Destroys an EasyPlayer handle + * \param err Optional error code + * + * Destroys an EasyPlayer handle previously created with CriMvEasyPlayer::Create(), and frees its resources. + * + * An EasyPlayer handle can only be destroyed when it is in the MVEASY_STATUS_STOP or MVEASY_STATUS_PLAYEND state. + * Attempting to destroy a handle when it is in any other state will cause an error. + * + * Any work buffers allocated via CriHeap, if still associated with the handle, are freed by this call. + * + * \sa CriMvEasyPlayer::Create(), CriMvEasyPlayer::Status, CriMvEasyPlayer::GetStatus() + */ + /*JP + * \ingroup MODULE_INIT + * \brief EasyPlayernh̔j + * \param err G[iȗj + * + * CriMvEasyPlayer::Create()ō쐬EasyPlayernhj܂B + * + * nhԂ MVEASY_STATUS_STOP A MVEASY_STATUS_PLAYEND ̎ɂ̂݃nhj邱Ƃł܂B
+ * ȊȌԂŌĂяoꍇ́AG[ɂȂ܂B
+ * + * nhԂ MVEASY_STATUS_ERROR ꍇ́ACriMvEasyPlayer::Stop() Ăяo + * MVEASY_STATUS_STOP ԂɂȂĂnhjĂB
+ * nhԂ CriMvEasyPlayer::GetStatus() ŊmF邱Ƃł܂B + * + * nh쐬Ɏw肵CriHeapɂĊmۂꂽŖ̑SẮA + * ̊֐̌Ăяoɂĉ܂B + * + * \sa CriMvEasyPlayer::Create(), CriMvEasyPlayer::Status, CriMvEasyPlayer::GetStatus() + */ + void Destroy(CriError &err=CriMv::ErrorContainer); + + /*EN + * \ingroup MODULE_BASIC + * + * \brief Returns status of an EasyPlayer handle. + * \param err Optional error code + * \return Handle status + * + * Returns the current status of an EasyPlayer handle. The status will be one of the values + * defined by CriMvEasyPlayer::Status. + * + * \sa CriMvEasyPlayer::Status + */ + /*JP + * \ingroup MODULE_BASIC + * \brief nhԂ̎擾 + * \param err G[iȗj + * \return nh CriMvEasyPlayer::Status + * + * nhԂ擾܂B + * + * \sa CriMvEasyPlayer::Status + */ + Status GetStatus(CriError &err=CriMv::ErrorContainer); + + /*EN + * \ingroup MODULE_BASIC + * + * \brief Executes heatbeat functions for an EasyPlayer handle + * \param err Optional error code + * + * Performs regular processing for an EasyPlayer handle, including handoff and parsing of input + * buffers, and audio decoding. Additionally, it checks for situations where the handle state + * should change to one of the values defined by CriMvEasyPlayer::Status, and changes state as + * necessary. + * + * This function and CriMvEasyPlayer::ExecuteDecode() should be called periodically during movie + * playback or when waiting for CriMvEasyPlayer::DecodeHeader() to complete. It takes a relatively + * low CPU load, and should typically be called on every vertical blank. + * + * \remarks + * Note that this function does not perform any video decoding. Decoding is done in + * CriMvEasyPlayer::ExecuteDecode(). + * + * \sa CriMvEasyPlayer::Status, CriMvEasyPlayer::ExecuteDecode(), CriMvEasyPlayer::DecodeHeader() + */ + /*JP + * \ingroup MODULE_BASIC + * \brief EasyPlayerT[o֐ + * \param err G[iȗj + * + * [r̃wb_͂̓obt@AI[fBIfR[hs܂B
+ * EasyPlayer nh̏ԑJڂ̊֐ōs܂B
+ * ̊֐̓rfĨfR[h͍s܂B̂CPUׂ͂܂荂Ȃ܂B
+ * {֐̓AvP[ṼC[vŖĂяo悤ɂĂB + * + * \sa CriMvEasyPlayer::Status + */ + void Update(CriError &err=CriMv::ErrorContainer); + + /*EN + * \ingroup MODULE_BASIC + * + * \brief Synchronizes the master timer of an EasyPlayer handle. + * \param err Optional error code + * + * Synchronizes the timing of video frames to the master timer used by this EasyPlayer handle. + * If the master timer is of type MVEASY_TIMER_AUDIO and the movie does not have audio, + * EasyPlayer will use the system timer that was set when the handle was created. + * + * \sa CriMvEasyPlayer::TimerType, CriMvEasyPlayer::SetMasterTimer(), CriMvSystemTimerInterface + */ + /*JP + * \ingroup MODULE_BASIC + * \brief }X^^C}ւ̓ + * \param err G[iȗj + * + * [rĐ}X^^C}ɓ܂B
+ * }X^^C} CriMvEasyPlayer::SetMasterTimer() ɂĎw肳ꂽ^C}g܂B
+ * ^C}ʂƂ MVEASY_TIMER_AUDIO w肳ĂāAĐ郀[rɃI[fBI + * ܂܂ĂȂꍇ́Anh쐬̃VXe^C}gp܂B + * + * ̊֐́Anh쐬Ɏw肵VXe^C}C^tF[X + * CriMvSystemTimerInterface::GetTime() Ăяo܂B + * + * \sa CriMvEasyPlayer::TimerType, CriMvEasyPlayer::SetMasterTimer(), CriMvSystemTimerInterface + */ + void SyncMasterTimer(CriError &err=CriMv::ErrorContainer); + + /*EN + * \ingroup MODULE_BASIC + * + * \brief Decodes a video frame + * \param err Optional error code + * \return \a TRUE If the movie is currently in a playback state + * \return \a FALSE If the movie is not playing + * + * Performs the actual video decoding. Each call to this function decodes a single frame. + * It does not return until the frame has been decoded. + * + * Video decoding can impose a very heavy CPU load, so calling this function from an application's + * main thread may cause your application to miss the vertical blank interval. To avoid this situation, + * ExecuteDecode() can be called from a separate, lower-priority thread. See the Mutithreaded Decoding + * tutorial for a full explanation. + * + * The return value describes the movie playback state. If TRUE, the movie is currently playing + * (or decoding the movie header) or ready to play. If FALSE, playback has not yet been started, + * or playback has finished. + * + * If a decoding thread is used, an application must wait until this function returns FALSE before destroying + * the thread. Otherwise, the handle state will not transition to MVEASY_STATUS_STOP or MVEASY_STATUS_PLAYEND, + * and the EasyPlayer handle cannot be destroyed. + * + * \attention + * ExecuteDecode() is the only CRI Movie function that is safe to call from a separate thread. + * No other CRI Movie functions should be considered to be thead-safe. + * + */ + /*JP + * \ingroup MODULE_BASIC + * \brief rfIfR[h + * \param err G[iȗj + * \return [rĐTRUE AĐI܂~FALSEԂ܂B + * + * rfIf[^̃fR[hs܂B
+ * {֐͂PsN`̃fR[hI܂ŏI܂B
+ * sN`fR[hׂ͕̍Ȃ̂ŁAAvP[ṼCXbhĂяoƏ”\܂B
+ * ̏ꍇ́ACXbhDx̒ႢʃXbhĂяo悤ɂĂB + * + * {֐̕ԂĺA[rĐ̎sǂ\Ă܂B
+ * fR[hpXbhIꍇ́AԂlFALSEɂȂ̂҂Ȃ΂܂B
+ * ԂlTRUE̊ԂɃfR[hXbhIĂ܂ƁAnh̏Ԃ MVEASY_STATUS_STOP + * MVEASY_STATUS_PLAYEND ɑJڂłAnhjoȂȂ܂B
+ * + */ + CriBool ExecuteDecode(CriError &err=CriMv::ErrorContainer); + + /* Đ */ + /*EN + * \ingroup MODULE_CONTROL + * + * \brief Sets the name of the movie file to play + * \param fname Name of the movie file + * \param err Optional error code + * + * Sets the name of the movie file to play, but does not open the file. The length of the filename + * (including path) is limited to CRIMV_MAX_FILE_NAME characters. EasyPlayer copies this + * string to internal memory, so a temporary variable can be used. + * + * If an application plays the same movie repeatedly, it only needs to call this function once. + * + * Multiple calls to this function will overwrite previous values. Calling CriMvEasyPlayer::SetData() + * will clear any filename set by this function. + * + * \remarks + * This function can only be called when the handle status is MVEASY_STATUS_STOP or MVEASY_STATUS_PLAYEND, + * or from the file request callback. See CriMvEasyPlayer::SetFileRequestCallback() for details. + * + * \remarks + * Calling this function does not open the file. The file is opened by a call to CriMvEasyPlayer::Update(). + * + * \sa CriMvEasyPlayer::SetFileRequestCallback(), CriMvEasyPlayer::SetData() + */ + /*JP + * \ingroup MODULE_CONTROL + * + * \brief Đt@C̎w + * \param fname [rt@CpX + * \param err G[iȗj + * + * Đ郀[r̃t@CpXݒ肵܂Bt@CpX̍ő咷 CRIMV_MAX_FILE_NAME oCgłB
+ * EasyPlayer͓ł̃t@CpXRs[̂ŁAœn͔jĂ܂܂B + * + * t@CJԂĐꍇ́Å֐ēxĂяoKv͂܂B + * + * ̊֐Ăяoɂx̊֐ĂяoƁAÕt@C͐Vt@Cɏ㏑܂B + * CriMvEasyPlayer::SetData()֐Ăяoꍇ́AOɐݒ肵t@C񂪃NA܂B + * + * \para l1F + * ̊֐̓nhԂ MVEASY_STATUS_STOP MVEASY_STATUS_PLAYEND̂݌Ăяo”\łB + * ܂̓t@CvR[obN֐ł̊֐ĂяoƂł܂Bڍׂ CriMvEasyPlayer::SetFileRequestCallback()֐ + * QƂĂB + * + * \para l2F + * ̊֐̓ł̓t@C̃I[vv͂܂Bt@C̃I[v CriMvEasyPlayer::Update() ֐̒ōs܂B + * + * \sa CriMvEasyPlayer::SetFileRequestCallback(), CriMvEasyPlayer::SetData(), CriMvEasyPlayer::SetFileRange() + */ + void SetFile(CriChar8 *fname, CriError &err=CriMv::ErrorContainer); + + /*EN + * \ingroup MODULE_CONTROL + * + * \brief Sets in-memory movie data + * \param dataptr Pointer to movie data + * \param datasize Size of data, in bytes + * \param err Optional error code + * + * Sets the in-memory data buffer for this EasyPlayer handle to point to the provided buffer, + * but does not attempt to read that buffer. After this call, the memory pointed to by \a dataptr + * belongs to CRI Movie and must remain valid until playback is complete. + * + * If an application plays the same movie data repeatedly, it only needs to call this function once. + * + * Multiple calls to this function will overwrite previous values. Calling CriMvEasyPlayer::SetFile() + * will clear any pointer set by this function. + * + * \remarks + * This function can only be called when the handle status is MVEASY_STATUS_STOP or MVEASY_STATUS_PLAYEND, + * or from the file request callback. See CriMvEasyPlayer::SetFileRequestCallback() for details. + * + * \remarks + * Calling this function does not attempt to reference the memory. The memory read is initiated by a call + * to CriMvEasyPlayer::DecodeHeader(), CriMvEasyPlayer::Prepare() or CriMvEasyPlayer::Start(). + * + * \sa CriMvEasyPlayer::SetFileRequestCallback(), CriMvEasyPlayer::SetFile(), CriMvEasyPlayer::SetFileRange() + */ + /*JP + * \ingroup MODULE_CONTROL + * \brief f[^̎w + * \param dataptr f[^|C^ + * \param datasize f[^TCY + * \param err G[iȗj + * + * ̊֐EasyPlayer̃nhԂMVEASY_STATUS_STOPMVEASY_STATUS_PLAYEND̎ɌĂяoĂB
+ * ܂́At@CvR[obN̓ŌĂяoƂł܂B
+ * + * {֐JԂĂяoꍇ́A͏㏑܂B
+ * CriMvEasyPlayer::SetFile()Ăяoꍇ́A{֐Ŏw肵̓nh܂B + * + * nhœ[rf[^JԂĐꍇ́A{֐̌Ăяo͏ȗ邱Ƃł܂B + * + * w肳ꂽ̈ɎۂɃANZX̂́A CriMvEasyPlayer::DecodeHeader(), CriMvEasyPlayer::Prepare(), + * CriMvEasyPlayer::Start() ̂ꂩĂяoꂽȍ~łB
+ * + * \sa CriMvEasyPlayer::SetFileRequestCallback(), CriMvEasyPlayer::SetFile(), CriMvEasyPlayer::SetFileRange() + */ + void SetData(CriUint8 *dataptr, CriUint32 datasize, CriError &err=CriMv::ErrorContainer); + + /*EN + * \ingroup MODULE_CONTROL + * \brief Set a pack file and pass offset and range of movie file to an EasyPlayer handle + * \param fname File name string pointer of the pack file + * \param offset offset in byte to movie data in the packing file [in bytes] + * \param range size of movie data from the offset in the packing file [in bytes] + * \param err Optional error code + * + * Sets the name of the pack file that contains the movie file to play. + * EasyPlayer tries to read data from 'offset' through 'range' in the pack file as the movie data. + * Passing a negative value as range, EasyPlayer reads data until the end of the pack file. + * + * The length of file name is limited until CRIMV_MAX_FILE_NAME. + * EasyPlayer handle copies the file name string into the handle. + * You can use a temporary variable as the file name string. + * + * If an application plays the same movie repeatedly, it only needs to call this function once. + * + * Multiple calls to this function will overwrite previous values. Calling CriMvEasyPlayer::SetData() + * will clear any filename set by this function. + * + * \remarks + * This function can only be called when the handle status is MVEASY_STATUS_STOP or MVEASY_STATUS_PLAYEND, + * or from the file request callback. See CriMvEasyPlayer::SetFileRequestCallback() for details. + * + * \remarks + * Calling this function does not open the file. The file is opened by a call to CriMvEasyPlayer::Update(). + * + * \sa CriMvEasyPlayer::SetFileRequestCallback(), CriMvEasyPlayer::SetData(), CriMvEasyPlayer::SetFile() + */ + /*JP + * \ingroup MODULE_CONTROL + * + * \brief Đ[rt@C܂ރpbNt@C̎w + * \param fname pbNt@C (pX܂) + * \param offset pbNt@C̃[rf[^܂ł̃ItZbg (P: oCg) + * \param range pbNt@C̃[rf[^̃TCY (PʁFoCg) + * \param err G[iȗj + * + * Đ郀[r܂ރpbNt@Cw肵܂BŎw肵 offset ʒu range TCY܂łpbNt@CɊ܂܂郀[rf[^݂Ȃ܂B + * rangeɕl͂ƃpbNt@C̏I[܂ł[rƂēǂݍ݂܂B + * + * pbNt@C̃t@CpX̍ő咷 CRIMV_MAX_FILE_NAME oCgłB + * EasyPlayer͓ł̃t@CpXRs[̂ŁAœn͔jĂ܂܂B + * + * t@CJԂĐꍇ́Å֐ēxĂяoKv͂܂B + * + * ̊֐ĂяoɁAx̊֐ĂяoƁAÕt@C͐Vt@Cɏ㏑܂B + * CriMvEasyPlayer::SetData()֐Ăяoꍇ́AOɐݒ肵t@C񂪃NA܂B + * + * \para l1F + * ̊֐̓nhԂ MVEASY_STATUS_STOP MVEASY_STATUS_PLAYEND̂݌Ăяo”\łB + * ܂̓t@CvR[obN֐ł̊֐ĂяoƂł܂Bڍׂ CriMvEasyPlayer::SetFileRequestCallback()֐ + * QƂĂB + * + * \para l2F + * ̊֐̓ł̓t@C̃I[vv͂܂Bt@C̃I[v CriMvEasyPlayer::Update() ֐̒ōs܂B + * + * \sa CriMvEasyPlayer::SetFileRequestCallback(), CriMvEasyPlayer::SetData(), CriMvEasyPlayer::SetFile() + */ + void SetFileRange(CriChar8 *fname, CriUint64 offset, CriSint64 range, CriError &err=CriMv::ErrorContainer); + + /* Õ[rf[^xo^it@CvR[obN֐ł̂݌ĂԂƁj */ + void SetPreviousDataAgain(CriError &err=CriMv::ErrorContainer); + + /*EN + * \ingroup MODULE_CONTROL + * + * \brief Reads movie header and analyzes movie information + * \param err Optional error code + * + * This function opens the movie file, reads the header, and starts to analyze the movie data. + * It does not start movie playback. + * + * When this function is called, the handle status changes to MVEASY_STATUS_DECHDR. Once EasyPlayer + * has finished reading the header and analyzing the movie, the status changes to MVEASY_STATUS_WAIT_PREP. + * When the status is MVEASY_STATUS_WAIT_PREP, CriMvEasyPlayer::GetMovieInfo() can be successfully called. + * + * To continue playback, call CriMvEasyPlayer::Prepare() or CriMvEasyPlayer::Start() when the handle status + * is MVEASY_STATUS_WAIT_PREP. + * + * \remarks + * This function can only be called when the handle status is MVEASY_STATUS_STOP or MVEASY_STATUS_PLAYEND. + * + * \remarks + * You must either call CriMvEasyPlayer::SetFile() or CriMvEasyPlayer::SetData(), or provide a file request + * callback with CriMvEasyPlayer::SetFileRequestCallback(), before calling this function. + * + * \remarks + * Once this function has been called, CriMvEasyPlayer::ExecuteDecode() and CriMvEasyPlayer::Update() must be + * called periodically in order for this function to have any effect. Otherwise, the handle status will + * never change. + * + * \sa CriMvEasyPlayer::GetStatus(), CriMvEasyPlayer::Prepare(), CriMvEasyPlayer::Start(), + * CriMvEasyPlayer::SetFileRequestCallback(), + * CriMvEasyPlayer::ExecuteDecode(), CriMvEasyPlayer::Update() + */ + /*JP + * \ingroup MODULE_CONTROL + * \brief [rwb_ + * \param err G[iȗj + * + * [r̍Đ͊JnAwb_͂̂ݍsđҋ@邽߂̊֐łB
+ * ̊֐gpăwb_͂Oɍς܂邱ƂɂAĐJnOɃ[r̉𑜓xI[fBȈ + * 邱Ƃł܂B
+ * {֐ĂяoƁAEasyPlayer̃nhԂMVEASY_STATUS_STOP MVEASY_STATUS_DECHDR ƑJڂĂA + * wb_͂MVEASY_STATUS_WAIT_PREPƂȂ܂B
+ * [r擾ɂ́AnhԂMVEASY_STATUS_WAIT_PREPɂȂƂ CriMvEasyPlayer::GetMovieInfo() + * sĂB
+ * + * nhԂMVEASY_STATUS_WAIT_PREP̎ɁA CriMvEasyPlayer::Prepare() CriMvEasyPlayer::Start() + * ĂԂƂōĐ𑱂邱Ƃł܂B
+ * + * {֐ EasyPlayer̃nhԂMVEASY_STATUS_STOPMVEASY_STATUS_PLAYEND̎ɌĂяoĂB + * + * {֐ĂяoO CriMvEasyPlayer::SetFile() CriMvEasyPlayer::SetData() Ń[rf[^w肵ĂB
+ * At@CvR[obN֐o^Ăꍇ͎Õ[rf[^ݒ͏ȗ邱Ƃ܂B + * + * \sa CriMvEasyPlayer::GetStatus(), CriMvEasyPlayer::Prepare(), CriMvEasyPlayer::Start(), CriMvEasyPlayer::SetFileRequestCallback() + */ + void DecodeHeader(CriError &err=CriMv::ErrorContainer); + + /*EN + * \ingroup MODULE_CONTROL + * + * \brief Reads movie header, analyzes movie information, and buffers data. + * \param err Optional error code + * + * This function opens the movie file and gets it ready for immediate playback, by reading and analyzing + * the header and decoding and buffering video data. It allows a movie to start playing immediately when + * CriMvEasyPlayer::Start() is called, without an initial delay. + * + * When this function is called, the handle status changes to MVEASY_STATUS_DECHDR. Once EasyPlayer + * has finished reading and analyzing the movie data, the status changes to MVEASY_STATUS_PREP and EasyPlayer + * begins decoding video data. When the initial video data has been decoded and buffered, the status changes to + * MVEASY_STATUS_READY. + * + * The amount of data that is buffered, in seconds, is based on the value set by CriMvEasyPlayer::SetBufferingTime(). + * By default, this is 1 second. + * + * When the status is MVEASY_STATUS_READY, movie playback will start imediately when CriMvEasyPlayer::Start() + * is called. + * + * \remarks + * Unless you CriMvEasyPlayer::DecodeHeader() first, this function can only be called when the handle status + * is MVEASY_STATUS_STOP or MVEASY_STATUS_PLAYEND. + * + * \remarks + * You must either call CriMvEasyPlayer::SetFile() or CriMvEasyPlayer::SetData(), or provide a file request + * callback with CriMvEasyPlayer::SetFileRequestCallback(), before calling this function. + * + * \remarks + * Once this function has been called, CriMvEasyPlayer::ExecuteDecode() and CriMvEasyPlayer::Update() must be + * called periodically in order for this function to have any effect. Otherwise, the handle status will + * never change. + * + * \sa CriMvEasyPlayer::GetStatus(), CriMvEasyPlayer::DecodeHeader(), CriMvEasyPlayer::Start(), + * CriMvEasyPlayer::SetBufferingTime(), CriMvInputBufferInfo + */ + /*JP + * \ingroup MODULE_CONTROL + * \brief Điwb_͂ƃobt@Oj + * \param err G[iȗj + * + * [r̍Đ͊JnAwb_͂ƍĐ݂̂sđҋ@邽߂̊֐łB
+ * ̊֐gpčĐOɍς܂邱ƂɂA[rĐJñ^C~Oׂ䂷邱Ƃł܂B
+ * iĐōĐJn֐Ăяoꍇ́AۂɍĐn܂܂łɃ^CO܂Bj
+ * {֐ĂяoƁAEasyPlayer̃nhԂMVEASY_STATUS_STOP MVEASY_STATUS_DECHDR MVEASY_STATUS_PREP ƑJڂĂA + * ĐMVEASY_STATUS_READYƂȂ܂B + * + * nhԂMVEASY_STATUS_READY̎ɁA CriMvEasyPlayer::Start() ĂԂƂōĐJn邱Ƃł܂B + * + * CriMvEasyPlayer::DecodeHeader() ̌Ăяoł̊֐Ăяoꍇ́ACriMvEasyPlayer̃nhԂ + * MVEASY_STATUS_STOPMVEASY_STATUS_PLAYEND łȂ΂܂B + * + * ĐJnOɂ CriMvEasyPlayer::SetFile() CriMvEasyPlayer::SetData() Ń[rf[^w肵ĂB
+ * At@CvR[obN֐o^Ăꍇ͎Õ[rf[^ݒ͏ȗ邱Ƃ܂B + * + * \sa CriMvEasyPlayer::GetStatus(), CriMvEasyPlayer::DecodeHeader(), CriMvEasyPlayer::Start(), + * CriMvEasyPlayer::SetBufferingTime(), CriMvInputBufferInfo + */ + void Prepare(CriError &err=CriMv::ErrorContainer); + + /*EN + * \ingroup MODULE_CONTROL + * + * \brief Starts movie playback + * \param err Optional error code + * + * Opens the movie and starts playback. If CriMvEasyPlayer::Prepare() was not called, there will be a + * delay while the library reads the movie header and buffers the initial data. If CriMvEasyPlayer::Prepare() + * was called and the handle status is MVEASY_STATUS_READY, playback will start as soon as this function is called. + * + * \remarks + * If you call this function without calling CriMvEasyPlayer::DecodeHeader() or CriMvEasyPlayer::Prepare() + * first, this function can only be called when the handle status is MVEASY_STATUS_STOP, MVEASY_STATUS_PLAYEND, + * or MVEASY_STATUS_READY. + * + * \remarks + * You must either call CriMvEasyPlayer::SetFile() or CriMvEasyPlayer::SetData(), or provide a file request + * callback with CriMvEasyPlayer::SetFileRequestCallback(), before calling this function. + * + * \remarks + * Once this function has been called, CriMvEasyPlayer::ExecuteDecode() and CriMvEasyPlayer::Update() must be + * called periodically in order for this function to have any effect. Otherwise, the movie will not play and + * the handle status will never change. + * + * \sa CriMvEasyPlayer::GetStatus(), CriMvEasyPlayer::DecodeHeader(), CriMvEasyPlayer::Prepare() + */ + /*JP + * \ingroup MODULE_CONTROL + * \brief ĐJn + * \param err G[iȗj + * + * [r̍ĐJn܂B
+ * CriMvEasyPlayer::Prepare()Ă΂ɁA{֐Ăяoꍇ́A[r̉͂ƍĐ̏s߁A + * ۂɃ[r̍Đn܂܂łɃ^CO܂B
+ * CriMvEasyPlayer::Prepare()ɌĂяoāAnhԂMVEASY_STATUS_READYɂȂĂ΁A + * ̊֐ĂяoĂɍĐn܂܂B + * + * CriMvEasyPlayer::DecodeHeader() ܂ CriMvEasyPlayer::Prepare() ̌Ăяoł̊֐Ăяoꍇ́A + * CriMvEasyPlayer̃nhԂ MVEASY_STATUS_STOPMVEASY_STATUS_PLAYEND łȂ΂܂B + * + * ĐJnOɂ CriMvEasyPlayer::SetFile() CriMvEasyPlayer::SetData() Ń[rf[^w肵ĂB
+ * At@CvR[obN֐o^Ăꍇ͎Õ[rf[^ݒ͏ȗ邱Ƃ܂B + * + * \sa CriMvEasyPlayer::GetStatus(), CriMvEasyPlayer::DecodeHeader(), CriMvEasyPlayer::Prepare() + */ + void Start(CriError &err=CriMv::ErrorContainer); + + /*EN + * \ingroup MODULE_CONTROL + * + * \brief Stops movie playback; resets a handle that is in an ERROR state, + * \param err Optional error code + * + * Tells the movie to stop playing and returns immediately. Note that this does not actually stop playback; + * an application must continue to call CriMvEasyPlayer::Update() and CriMvEasyPlayer::ExecuteDecode() until + * the status changes to MVEASY_STATUS_STOP. + * + * Once the handle is in the MVEASY_STATUS_STOP state, it can be reused for a different movie. + * + * If the handle state is MVEASY_STATUS_ERROR, an application must call this function and wait for the status + * to change to MVEASY_STATUS_STOP before destroying or reusing the player handle. + * + * In principle, this function does not reset any EasyPlayer handle parameters that were explicitly set via + * any of the settings APIs, so an application can replay the same movie by simply calling CriMvEasyPlayer::Start() + * once the state has changed to MVEASY_STATUS_STOP. However, calling this function will reset the following + * parameters: + * + * - The pause state (see CriMvEasyPlayer::Pause()) will be reset to OFF (not paused). + * - If a file request callback has been set (via CriMvEasyPlayer::SetFileRequestCallback()), the movie + * data information will be reset. + * + * See the description of CriMvEasyPlayer::ResetAllParameters() for a comparison of the parameters that are + * affected by that function and by this function. + * + * \remarks + * This function may call CriMvSoundInterface::Stop() and CriMvFileReaderInterface::Close(). For an EasyPlayer + * handle to change to MVEASY_STATUS_STOP, the sound and file interfaces need to transition to their STOP states. + * In the case of CriMvSoundInterface, this means that CriMvSoundInterface::GetStatus() will return + * MVEASY_SOUND_STATUS_STOP. For CriMvFileReaderInterface, this means that CriMvFileReaderInterface::GetCloseStatus() + * will return ASYNC_STATUS_COMPLETE. + * + * \sa CriMvEasyPlayer::Status, CriMvEasyPlayer::GetStatus(), CriMvEasyPlayer::ResetAllParameters() + */ + /*JP + * \ingroup MODULE_CONTROL + * \brief Đ~^G[Ԃ̕A + * \param err G[iȗj + * + * [rĐ~̗vo܂B{֐͑A֐łB{֐őSĂ̒~s킯ł͂܂B
+ * {֐ďoAĐԂ MVEASY_STATUS_STOP Ȃ܂ł͒ʏ̃C[v𓮂ĂB
+ * ̓Iɂ CriMvEasyPlayer::Update(), CriMvEasyPlayer::ExecuteDecode() ʏʂĂяoKv܂B + * + * ĐԂ MVEASY_STATUS_ERROR ɂȂꍇ́A{֐Ăяo MVEASY_STATUS_STOP ҂ĂB
+ * + * for[vȂǂɂ郍[J[vŏԕύX҂Ă MVEASY_STATUS_STOP ɂ͂Ȃ܂B
+ * + * {֐ĂяoĂAAvP[VĐnhɐݒ肵ep[^͌ƂăZbg܂B
+ * MVEASY_STATUS_STOP ԂɂȂƁAxĐJnƑOƓp[^ōĐsƂł܂B
+ * OIɖ{֐ŃZbgp[^͈ȉ̂̂܂B + * - CriMvEasyPlayer::Pause() ɂ|[YԂ́AOFFɃZbg܂B + * - t@CvR[obN֐̓o^ꍇA[rt@Ci܂̓j̏̓Zbg܂B + * + * Zbgp[^ꗗ CriMvEasyPlayer::ResetAllParameters() ̐QƂĂB + * + * {֐͕Kvɉ CriMvSoundInterface::Stop() CriMvFileReaderInterface::Close() Ăяo܂B
+ * EasyPlayer nh MVEASY_STATUS_STOP ԂɂȂ邽߂ɂ́AeC^tF[X~ԂɂȂȂ΂܂B
+ * TEhC^tF[X̏ꍇA CriMvSoundInterface::GetStatus() MVEASY_SOUND_STATUS_STOP ԂƁB
+ * t@Cǂݍ݃C^tF[X̏ꍇA CriMvFileReaderInterface::GetCloseStatus() AASYNC_STATUS_COMPLETE + * ԂȂ΂܂B + * + * \sa CriMvEasyPlayer::Status, CriMvEasyPlayer::GetStatus(), CriMvEasyPlayer::ResetAllParameters() + */ + void Stop(CriError &err=CriMv::ErrorContainer); + + /*EN + * \ingroup MODULE_CONTROL + * + * \brief Pauses or resumes movie playback + * \param sw Pause state. ON (1) will pause playback, OFF (0) will resume it. + * \param err Optional error code + * + * Pauses or resumes movie playback, depending on the argument. If \a sw is ON (1), playback will be paused. + * If \a sw is OFF (0), playback will be resumed. + * + * \remarks + * This function will call CriMvSoundInterface::Pause() and CriMvSystemTimerInterface::Pause() with the + * provided argument. + * + * \remarks + * Calling CriMvEasyPlayer::Stop() or CriMvEasyPlayer::ResetAllParameters() will set the pause state to OFF. + * + * \sa CriMvSoundInterface::Pause(), CriMvSystemTimerInterface::Pause() + */ + /*JP + * \ingroup MODULE_CONTROL + * \brief Đ̈ꎞ~܂͍ĊJ + * \param sw |[YXCb`B|[YON̏ꍇ1A|[YOFF(W[)̏ꍇ0w肵܂B + * \param err G[iȗj + * + * {֐͈̓Ɉˑ܂B
+ * sw ON(1)ȂAꎞ~B sw OFF(0)ȂĐĊJłB + * + * CriMvEasyPlayer::Stop() ܂ CriMvEasyPlayer::ResetAllParameters Ăяoƃ|[YԂOFFɃZbg܂B + * + * ̊֐ CriMvSoundInterface::Pause() CriMvSystemTimerInterface::Pause() 𓯂ŌĂяo܂B + * + * \sa CriMvSoundInterface::Pause(), CriMvSystemTimerInterface::Pause() + */ + void Pause(CriBool sw, CriError &err=CriMv::ErrorContainer); + + CriBool IsPaused(CriError &err=CriMv::ErrorContainer); + + /* IvVݒ^擾 */ + /*EN + * \ingroup MODULE_OPTION + * + * \brief Sets the type of timer used for video synchronization + * \param type Type of timer to use + * \param err Optional error code + * + * In order to display video frames at the proper rate, CRI Movie uses a timer to determine when the + * next frame should be shown. For a movie with an audio track, you would typically use the + * MVEASY_TIMER_AUDIO timer type. For a movie with no audio, the MVEASY_TIMER_SYSTEM type timer + * should be used. + * + * The default is the timer type that was passed to CriMvEasyPlayer::Create(). If this value + * was NULL, a system timer (MVEASY_TIMER_SYSTEM) will be used. + * + * \remarks + * If an audio timer (MVEASY_TIMER_AUDIO) is wanted, it must be created and passed to + * CriMvEasyPlayer::Create(). + * + * \remarks + * If the movie does not have an audio track, CRI Movie will use a MVEASY_TIMER_SYSTEM regardless of + * the value set by this function. + * + * \sa CriMvEasyPlayer::GetMasterTimer(), CriMvEasyPlayer::Create(), TimerType + */ + /*JP + * \ingroup MODULE_OPTION + * \brief }X^^C}ʂ̎w + * \param type }X^^C} + * \param err G[iȗj + * + * rfIt[̎ǗɎgp^C}ʂw肵܂B
+ * ftHg̓nh쐬Ɏw肷VXe^C}łB
+ * rfIt[̕\^C~OI[fBI̎ƓƂ̓I[fBI^C}w肵ĂB
+ * I[fBI^C}w肵ꍇłAĐ郀[rɃI[fBI܂܂ĂȂꍇ̓VXe^C}ƂȂ܂B + * + * \sa CriMvEasyPlayer::GetMasterTimer(), CriMvEasyPlayer::Create() + */ + void SetMasterTimer(TimerType type, CriError &err=CriMv::ErrorContainer); // default is SYSTEM + + /*EN + * \ingroup MODULE_OPTION + * + * \brief Returns the type of timer currently being used by the EasyPlayer handle + * \param err Optional error code + * \return The current timer type + * + * Returns the current type of timer used to synchronize video frames. This value can be changed + * by calling CriMvEasyPlayer::SetMasterTimer(). Otherwise, the timer type is set when the handle + * is created. + * + * \sa CriMvEasyPlayer::SetMasterTimer(), CriMvEasyPlayer::Create(), TimerType + */ + /*JP + * \ingroup MODULE_OPTION + * \brief }X^^C}ʂ̎擾 + * \param err G[iȗj + * \return ݐݒ肳Ă}X^^C} + * + * ݐݒ肳Ă}X^^C}ʂ擾܂B + * + * \sa CriMvEasyPlayer::SetMasterTimer() + */ + TimerType GetMasterTimer(CriError &err=CriMv::ErrorContainer); + + /*EN + * \ingroup MODULE_OPTION + * + * \brief Sets the number of internal video buffers + * \param npools The number of buffers to use; must be greater than 0 + * \param err Optional error code + * + * CRI Movie uses internal memory, or frame pools, to buffer decoded frames before display. + * More frame pools can help smooth out playback under high CPU loads. + * + * \remarks + * By default, the number of pools is 1. To change the value, this function must be called + * before starting playback (with either CriMvEasyPlayer::Prepare() or CriMvEasyPlayer::Start()). + */ + /*JP + * \ingroup MODULE_OPTION + * \brief rfIobt@it[v[j̎w + * \param npools rfIobt@iŒłPj + * \param err G[iȗj + * + * EasyPlayernh̃rfIobt@w肵܂B
+ * ̓rfIobt@̓fR[hʂ~Ă߂̂̂ŁAt[v[ƌĂт܂B
+ * t[v[قǐsărfIfR[hi߂邱Ƃł邽߁AfR[h + * וϓ傫AfR[hɎgpłCPUԂ̕ϓ傫ꍇɂX[YȍĐ + * s₷Ȃ܂B
+ * ftHg̃t[v[͂PłB
+ * t[v[ύXꍇ́AĐJnO( CriMvEasyPlayer::Prepare()܂ CriMvEasyPlayer::Start()) + * {֐sĂB + */ + void SetNumberOfFramePools(CriUint32 npools, CriError &err=CriMv::ErrorContainer); + + /*EN + * \ingroup MODULE_OPTION + * + * \brief Sets the amount of movie data that will be buffered, in seconds + * \param sec Buffering time, in seconds + * \param err Optional error code + * + * CRI Movie buffers enough raw data from disk to allow for smooth playback and to reduce disk reads. + * The buffer size is based on the bitrate of the movie, and other movie parameters. + * + * By default, this buffer will be large enough to hold 1 second worth of playback. + * + * To determine the current buffering time, look at the \a buffering_time field of the + * CriMvStreamingParameters structure, which is retrieved by calling CriMvEasyPlayer::GetMovieInfo(). + * + * \remarks + * If this function is called, it must be called before starting playback (with either + * CriMvEasyPlayer::Prepare() or CriMvEasyPlayer::Start()). + * + * \remarks + * Passing \a 0.0 as the value of \a sec will reset the buffering time to the default value. + * + * \remarks + * If an application calls CriMvEasyPlayer::SetStreamingParameters() for a handle, this function + * can not be used with that handle. + * + * \remarks + * The value set by this function, along with the value set by CriMvEasyPlayer::SetReloadThresholdTime(), + * determine how often data is read from disk. See the description of + * CriMvEasyPlayer::SetReloadThresholdTime() for details. + * + * \sa CriMvEasyPlayer::SetReloadThresholdTime(), CriMvEasyPlayer::GetInputBufferInfo(), + * CriMvStreamingParameters + */ + /*JP + * \ingroup MODULE_OPTION + * \brief ̓f[^̃obt@OԂ̎w + * \param sec obt@OԁBPʂ͕bB + * \param err G[iȗj + * + * Xg[~OĐŃobt@O̓f[^̗ʂbPʂ̎ԂŎw肵܂B
+ * EasyPlayeŕAobt@OԂƃ[r̃rbg[gǂݍ݃obt@̃TCY肵܂B + * + * ftHg̃obt@OԂ́AĐJn_ŃAvP[V쐬ς݂EasyPlayernh + * ɈˑČ܂܂BEasyPlayernhP‚ɂ‚Pb̃obt@OԂmۂ܂BAv + * P[VR‚EasyPlayernh쐬ĂꍇAobt@OԂ͂RbƂȂ܂B + * + * EasyPlayernhb̃obt@OԂɂȂĂ邩 CriMvEasyPlayer::GetMovieInfo + * ֐Ŏ擾 CriMvStreamingParameters \̂̕ϐ buffering_time ŊmFł܂B + * + * {֐̌ĂяóA CriMvEasyPlayer::Prepare ֐܂ CriMvEasyPlayer::Start ֐̑O܂łɎsĂB + * + * obt@OԂ 0.0f w肵ꍇAobt@OԂ̓CũftHglƂȂ܂B
+ * ܂AAvP[V CriMvEasyPlayer::SetStreamingParameters ֐Ăяoꍇ͖{֐ + * ݒ肵lA CriMvEasyPlayer::SetStreamingParameters ֐̎w肪D悳܂B + * + * \sa CriMvEasyPlayer::SetReloadThresholdTime(), CriMvEasyPlayer::GetInputBufferInfo() + */ + void SetBufferingTime(CriFloat32 sec, CriError &err=CriMv::ErrorContainer); + + /*EN + * \ingroup MODULE_OPTION + * + * \brief Determines how often the movie data buffer is refilled from disk + * \param sec Number of seconds of playback time to buffer + * \param err Optional error code + * + * EasyPlayer buffers raw data from disk to allow for smooth playback. How often it refills + * its buffers is determined by this function. When the amount of data remaining, in seconds, + * falls below this value, EasyPlayer will call into the FileReader module for this handle in + * order to read more data. + * + * SetBufferingTime() sets a "low water mark" for the data buffer. For instance, if an application + * sets the buffer size to 4 seconds (with CriMvEasyPlayer::SetBufferingTime()), and sets the reload + * threshold to 1 second, then CRI Movie will initially fill the buffer with 4 seconds worth of + * data. After 3 seconds worth of data have been decoded and consumed, there will be less than + * \a reload \a threshold seconds of data remaining, and CRI Movie will refill the buffer. + * + * \remarks + * The default value for \a sec is 0.8s. + * + * \remarks + * If this function is called, it must be called before starting playback (with either + * CriMvEasyPlayer::Prepare() or CriMvEasyPlayer::Start()). + * + * \sa CriMvEasyPlayer::SetBufferingTime(), CriMvEasyPlayer::GetInputBufferInfo(), CriMvFileReaderInterface + */ + /*JP + * \ingroup MODULE_OPTION + * \brief ēǂݍ臒l̎Ԏw + * \param sec Ԏwɂēǂݍ臒lBPʂ͕bB + * \param err G[iȗj + * + * EasyPlayernh́A̓obt@̃f[^ēǂݍ臒lȉɂȂɎ̃f[^ǂݍ݂s܂B + * ēǂݍ臒l͖{֐ɂw莞Ԃƃ[rf[^̃rbg[gɂĎIɌvZ܂B + * ēǂݍ臒l͎[b]Ŏw肵܂BftHgl0.8błB + * + * [rĐɃf[^𗠓ǂ݂ꍇȂǂɃV[N񐔂炷߂臒lݒ𗘗p邱Ƃł܂B + * Ⴆ΁Aobt@OԂ2bAēǂݍ臒l1bɐݒ肷ƁA[rf[^̓ǂݍ݂͖1b1̎sɂȂ܂B + * 邱ƂŁA1b̊Ԃ̓f[^̓ǂݍ݂AIɍsƂł܂B + * + * [rĐȂ烆[Uf[^̓ǂݍ݂sꍇA[Uf[^̓ǂݍ݂͖{֐Ŏw肵Ԉȓɓǂݍ + * I悤ɂĂBTCY̑傫ȃf[^͕ɕēǂݍނȂǂ̑ΏKvɂȂ܂B + * {֐Ŏw肵ԈȓɃ[Uf[^̓ǂݍ݂IȂꍇA[rf[^͊ă[rĐ؂܂B + * + * {֐̌ĂяóA CriMvEasyPlayer::Prepare ֐܂ CriMvEasyPlayer::Start ֐̑O܂łɎsĂB + * + * [rĐ̓̓obt@̃f[^ʂēǂݍ臒l̃TCÝACriMvEasyPlayer::GetInputBufferInfo Ŏ擾”\łB + * + * \sa CriMvEasyPlayer::SetBufferingTime(), CriMvEasyPlayer::GetInputBufferInfo() + */ + void SetReloadThresholdTime(CriFloat32 sec, CriError &err=CriMv::ErrorContainer); + + /*EN + * \ingroup MODULE_OPTION + * + * \brief Retrieves input data buffering settings + * \param ibuf_info Input buffer information structure + * \param err Optional error code + * + * Populates the passed CriMvInputBufferInfo structure with the values of the settings + * for the raw input buffer size, the reload interval, and the amount of data currently buffered. + * + * \remarks + * This function can be called once the handle status has transitioned to MVEASY_STATUS_WAIT_PREP. + * + * \sa CriMvInputBufferInfo, CriMvEasyPlayer::SetBufferingTime(), CriMvEasyPlayer::SetReloadThresholdTime() + */ + /*JP + * \ingroup MODULE_OPTION + * \brief ̓obt@̎擾 + * \param ibuf_info ̓obt@ + * \param err G[iȗj + * + * ̓obt@ CriMvInputBufferInfo 擾܂B
+ * ̓obt@EasyPlayernh̏Ԃ MVEASY_STATUS_WAIT_PREP ȍ~ɂȂƎ擾ł܂B
+ * + * \sa CriMvInputBufferInfo, CriMvEasyPlayer::SetBufferingTime(), CriMvEasyPlayer::SetReloadThresholdTime() + */ + void GetInputBufferInfo(CriMvInputBufferInfo &ibuf_info, CriError &err=CriMv::ErrorContainer); + + /*EN + * + * \brief Sets the maximum bitrate EasyPlayer will assume for movie data + * \param max_bitrate Maximum bitrate, in bits/second + * \param err Optional error code + * + * EasyPlayer determines the size of its input data buffer by the movie's bitrate, the buffering time, + * and other movie parameters. In normal usage, an application should not need to call this function. + * However, it can be useful when doing concatenated playback of several movies sequentially. + * + * If the bitrate of the first movie is smaller or larger than the next movie, EasyPlayer can choose + * a buffer size that will be appropriate for the first movie, but either too small for the next + * (causing excessive disk reads or playback stuttering) or too large (using more memory than necessary). + * + * Passing a value of 0 for \a max_bitrate will cause the handle to revert to its default behavior + * for determining maximum bitrate. + * + * \remarks + * The value set by this function will not be reflected in the \a max_bitrate field of the + * CriMvStreamingParameters structure, which will contain the actual value as stored in the movie's + * header. + * + * \remarks + * If this function is called, it must be called before starting playback (with either + * CriMvEasyPlayer::Prepare() or CriMvEasyPlayer::Start()). + * + * \remarks + * If an application calls CriMvEasyPlayer::SetStreamingParameters() for a handle, this function + * can not be used with that handle. + * + * \remarks + * For details about concatenated playback, see the description of CriMvEasyPlayer::SetFileRequestCallback(). + * + * \sa CriMvEasyPlayer::SetBufferingTime(), CriMvEasyPlayer::SetReloadThresholdTime(), + * CriMvEasyPlayer::SetFileRequestCallback() + */ + /*JP + * \ingroup MODULE_OPTION + * \brief őrbg[g̎w + * \param max_bitrate őrbg[g(bit per second) + * \param err G[(ȗ) + * + * [rf[^̍őrbg[gw肵܂Bőrbg[g̓Xg[ĐpɊmۂobt@TCYɉe܂B
+ * + * PĐ͖{֐ĂяoKv͂܂BEasyPlayernhIɍőrbg[g擾ĕKvȂ + * ǂݍ݃obt@mۂ܂B
+ * + * AĐɁA擪̃[rt@C̃rbg[g㑱̃[rt@CƔׂċɒ[ɏꍇɂ́A{֐gp + * Iɍőrbg[g傫w肵ĂB
+ * + * {֐Őݒ肵őrbg[ǵACriMvEasyPlayer::GetMovieInfo ֐Ŏ擾郀[rɂ͔f܂B + * CriMvEasyPlayer::GetMovieInfo ֐Ŏ擾ł̂̓[rf[^̖{̏łB
+ * + * {֐̌ĂяóA CriMvEasyPlayer::Prepare ֐܂ CriMvEasyPlayer::Start ֐̑O܂łɎsĂB
+ * + * őrbg[g 0w肵ꍇAőrbg[g̓[rf[^̎’lƂȂ܂B
+ * ܂AAvP[V CriMvEasyPlayer::SetStreamingParameters ֐Ăяoꍇ͖{֐ + * ݒ肵lA CriMvEasyPlayer::SetStreamingParameters ֐̎w肪D悳܂B + * + * \sa CriMvEasyPlayer::SetBufferingTime(), CriMvEasyPlayer::SetReloadThresholdTime(), + * CriMvEasyPlayer::SetFileRequestCallback() + */ + void SetMaxBitrate(CriUint32 max_bitrate, CriError &err=CriMv::ErrorContainer); + + /*EN + * \ingroup MODULE_OPTION + * + * \brief Sets the audio playback track + * \param track Audio track number + * \param err Optional error code + * + * If a movie has multiple audio tracks (for instance, English and Spanish versions), this function + * will determine which track plays. By default, the first audio track is used. + * + * To determine the number of audio tracks in the movie, call CriMvEasyPlayer::GetMovieInfo() and + * look at the \a num_audio field of the CriMvStreamingParameters structure. + * + * If the movie does not have any audio, this function has no effect. + * + * \remarks + * To use the default setting, set \a track to CRIMV_AUDIO_TRACK_AUTO. + * + * \remarks + * To turn off audio altogether, set \a track to CRIMV_AUDIO_TRACK_OFF. + * + * \sa CriMvEasyPlayer::GetMovieInfo() + */ + /*JP + * \ingroup MODULE_OPTION + * \brief ĐI[fBIgbN̎w + * \param track ĐI[fBIgbN + * \param err G[iȗj + * + * [r̃I[fBIgbNĂꍇɁAĐI[fBIw肵܂B
+ * ĐJnO( CriMvEasyPlayer::Prepare()܂ CriMvEasyPlayer::Start())ɖ{֐sĂB + * + * {֐sȂꍇ́AƂႢԍ̃I[fBIgbNĐ܂B
+ * CriMvEasyPlayer::DecodeHeader() CriMvEasyPlayer::GetMovieInfo()gƂŁAǂ̃`l + * ǂȃI[fBIĂ邩ĐJnOɒm邱Ƃł܂B + * + * f[^݂ȂgbNԍw肵ꍇ́AI[fBI͍Đ܂B + * + * gbNԍƂCRIMV_AUDIO_TRACK_OFFw肷ƁAႦ[rɃI[fBI܂܂Ă + * ĂI[fBI͍Đ܂B + * + * ܂AftHgݒiƂႢ`l̃I[fBIĐjɂꍇ́A + * `lƂCRIMV_AUDIO_TRACK_AUTOw肵ĂB + * + * \sa CriMvEasyPlayer::GetMovieInfo(), CriMvEasyPlayer::DecodeHeader() + */ + void SetAudioTrack(CriSint32 track, CriError &err=CriMv::ErrorContainer); + + /*EN + * \ingroup MODULE_OPTION + * + * \brief Turns movie looping on or off + * \param sw Looping value + * \param err Optional error code + * + * If \a sw is 1 (ON), the movie will loop continuously. + * If \a sw is 0 (OFF), the movie will play normally. + * + * In normal usage, a movie will play once, with the handle status changing to MVEASY_STATUS_PLAYEND + * when it completes. When looping is ON, this behavior changes. When the movie reaches the + * end, it will immediately start playing again from the beginning, and the status will continue to + * toggle between MVEASY_STATUS_PLAYING and MVEASY_STATUS_PREP. + * + * If looping is ON, and the playback is from a file, EasyPlayer will call CriMvFileReaderInterface::Seek() + * as necessary to reset the file pointer. + * + * \remarks + * If looping is ON, and an application sets it to OFF while the movie is playing, playback might + * not stop at the end of the movie. In that case, playback will end after the next loop iteration. + * + * \sa CriMvEasyPlayer::GetLoopFlag(), CriMvFileReaderInterface::Seek() + */ + /*JP + * \ingroup MODULE_OPTION + * \brief [vĐtO̎w + * \param sw [vXCb`BON̏ꍇ̓[vAOFF̏ꍇ̓[vɂȂ܂B + * \param err G[iȗj + * + * [vĐ̗Lݒ肵܂BftHg̓[vOFFłB
+ * [vĐONɂꍇ́A[ȑI[܂ōĐĂnhԂMVEASY_STATUS_PLAYENDɂȂ炸A + * [r̐擪ĐJԂ܂B
+ * t@CwōĐĂꍇ́AŌ܂œǂݍ񂾂 CriMvFileReaderInterface::Seek()g + * ǂݍ݈ʒut@C̐擪ɖ߂܂B + * + * [vĐOFFɐݒ肵ꍇ́ÂƂǂݍł[ȑI[܂ōĐƁA + * nhԂMVEASY_STATUS_PLAYENDɑJڂ܂B
+ * ĐɃ[vOFFɂꍇA^C~OɂẮAĐ̃[rI[ŏI炸ǍJԂ + * Đ܂Ŏs܂B + * + * ݂̃[vݒ擾ɂ CriMvEasyPlayer::GetLoopFlag()gĂB + * + * \sa CriMvEasyPlayer::GetLoopFlag(), CriMvFileReaderInterface::Seek() + */ + void SetLoopFlag(CriBool sw, CriError &err=CriMv::ErrorContainer); + + /*EN + * \ingroup MODULE_OPTION + * + * \brief Retrieves the value of the looping flag + * \return The current looping setting + * + * By default, looping is OFF and playback will stop when it reaches the end. You can + * change this behavior by calling CriMvEasyPlayer::SetLoopFlag(). + * + * \sa CriMvEasyPlayer::SetLoopFlag() + */ + /*JP + * \ingroup MODULE_OPTION + * \brief [vĐtO̎擾 + * \param err G[iȗj + * \return ݂̃[vĐݒ + * + * ݂̃[vݒ擾܂B + * [vݒ CriMvEasyPlayer::SetLoopFlag() ŕύX邱Ƃł܂B + * + * \sa CriMvEasyPlayer::SetLoopFlag() + */ + CriBool GetLoopFlag(CriError &err=CriMv::ErrorContainer); + + /*EN + * \ingroup MODULE_OPTION + * + * \brief Gets the amount of time that a movie has been playing + * \param count Number of timer units since the movie started playing + * \param unit Number of timer units per second + * \param err Optional error code + * + * This function retrieves the absolute time that has elapsed since a movie started playing. + * The time value is returned in two parts - a counter with an arbitrary interval, and the + * number of timer ticks per second. To determine the playing time in seconds, divide + * \a count by \a unit. + * + * Before playback has started, and after it has stopped, this function will return a \a count value of 0. + * + * The value retrieved is the value of the master timer for the handle, not the time of the current frame itself. + * To get the video frame time, check the CriMvFrameInfo structure once you have retrieved the frame. + * + * \remarks + * Note that this function provides an absolute playback time - it does not wrap to 0 + * when the movie loops. + * + */ + /*JP + * \ingroup MODULE_OPTION + * \brief Đ̎擾 + * \param count ^C}JEg + * \param unit Pb̃^C}JEglBcount unit ŕbPʂ̎ƂȂ܂B + * \param err G[iȗj + * + * ^C}擾܂Bcountunit̓‚̕ϐŕ\܂B
+ * count unit ŕbPʂ̎ƂȂ悤ȒlԂ܂B
+ * ĐJnOi CriMvSoundInterface::Start()ĂяoOj + * Đ~i CriMvSoundInterface::Stop()Ăяoj́AOi^C}JEgOjԂ܂B
+ * {֐̓}X^^C}Ŏw肳ꂽ^C}̎ԂŁArfIt[̎Ԃ̂ł͂܂B
+ * 擾rfIt[̖{̕\́ArfIt[擾 CriMvFrameInfo \̂QƂĂB + */ + void GetTime(CriUint64 &count, CriUint64 &unit, CriError &err=CriMv::ErrorContainer); // only refer time of SyncMasterTimer + + /*EN + * \ingroup MODULE_OPTION + * + * \brief Gets information about the movie + * \param stmprm Movie information structure + * \param err Optional error code + * \return TRUE if movie information was successfully retrieved + * \return FALSE if the header has not yet been decoded, or if an error occurred + * + * Populates the passed \a CriMvStreamingParameters structure with information about the current movie, + * including the bitrate, resolution, audio track information, subtitle availability, and more. + * + * This function is available once the handle status has changed to MVEASY_STATUS_WAIT_PREP. If an application + * needs this information before starting playback (for instance, to set up for playing subtitles, or to + * allocate a display surface based on the size of the movie), call CriMvEasyPlayer::DecodeHeader(), then + * call GetMovieInfo(). + * + * \remarks + * When doing concatenated playback (via CriMvEasyPlayer::SetFileRequestCallback()), GetMovieInfo() will + * return information about the currently playing movie. + * + * \sa CriMvEasyPlayer::DecodeHeader(), CriMvEasyPlayer::SetFileRequestCallback() + */ + /*JP + * \ingroup MODULE_OPTION + * \brief [r̎擾 + * \param stmprm [r + * \param err G[iȗj + * + * [r CriMvStreamingParameters 擾܂B
+ * [r񂩂͎Ƀrbg[g𑜓xAI[fBIȂǂ킩܂B
+ * [rEasyPlayernh̏Ԃ MVEASY_STATUS_WAIT_PREP ȍ~ɂȂƎ擾ł܂B
+ * ĐJnOɃ[rm肽ꍇ́A CriMvEasyPlayer::DecodeHeader()Ăяoăwb_͂sĂB + * + * AĐsꍇAŌɎ擾t[܂ރ[rt@Cɂ‚Ă̏Ԃ܂B + * + * \sa CriMvEasyPlayer::DecodeHeader() + */ + CriBool GetMovieInfo(CriMvStreamingParameters &stmprm, CriError &err=CriMv::ErrorContainer); + + /*EN + * \ingroup MODULE_OPTION + * + * \brief Changes the parameters for the movie + * \param stmprm Movie information structure + * \param err Optional error code + * + * This is a DEBUG function and should not normally be used by applications. + * + * This function allows an application to change the streaming parameters for the movie as a whole. + * It is available once the handle status has changed to MVEASY_STATUS_WAIT_PREP. + * + * To use this function, first call CriMvEasyPlayer::DecodeHeader(), then call CriMvEasyPlayer::GetMovieInfo() + * to retrieve the current movie parameters. Change the fields of the CriMvStreamingParameters structure + * as appropriate, then call SetStreamingParameters(). + * + * \sa CriMvEasyPlayer::GetMovieInfo(), CriMvEasyPlayer::DecodeHeader() + */ + /*JP + * \ingroup MODULE_OPTION + * \brief Xg[~Op[^̕ύX + * \param stmprm Xg[~Op[^ + * \param err G[iȗj + * + * {֐͒ʏAAvP[V͎gp܂BfobOp̊֐łB + * + * [rĐ̂߂̃Xg[~Op[^EasyPlayernhɐݒ肵܂B
+ * Xg[~Op[^wł̂́AEasyPlayernhԂMVEASY_STATUS_WAIT_PREP̎łB
+ * ̊֐́Aǂݍ݃obt@TCYȂǍׂȃp[^SăAvP[VŒꍇɎg܂B
+ * CriMvEasyPlayer::DecodeHeader()Ńwb_͂sƁA CriMvEasyPlayer::GetMovieInfo()Ŏ擾ł + * [r񂪂̂܂܃Xg[~Op[^ƂȂ܂̂ŁAlύXāA{֐Őݒ肵Ȃ + * ĂB + * + * \sa CriMvEasyPlayer::GetMovieInfo(), CriMvEasyPlayer::DecodeHeader() + */ + void SetStreamingParameters(CriMvStreamingParameters *stmprm, CriError &err=CriMv::ErrorContainer); + + /*EN + * \ingroup MODULE_VIDEO_FRAME + * + * \brief Determine if a new video frame can be displayed + * + * \param err Optional error code + * + * \return TRUE if a frame is ready to be displayed + * \return FALSE if the movie is paused or not playing, or if a new frame is + * not yet decoded or ready to be displayed + * + * Each frame in a movie corresponds to an absolute time, with the first frame being time 0. + * The playback time is controlled by the master timer for this handle. + * If the time of the next frame is less than or equal to the current playback time, as determined + * by CriMvEasyPlayer::GetTime(), it is ready to be displayed, and this function will return TRUE. + * + * If an application needs to do some complex or lengthy processing before displaying a frame (such + * as locking a texture), it should call this function first. + * + * \remarks + * If the next frame has not yet been decoded, this function will return FALSE regardless of the playback time. + * + * \sa CriMvEasyPlayer::GetTime() + */ + /*JP + * \ingroup MODULE_VIDEO_FRAME + * \brief t[̕\ + * \param err G[iȗj + * \return ̃rfIt[łɕ\ɂȂĂꍇTRUE(1)Ԃ܂B
+ * ̃rfIt[܂fR[hłȂꍇFALSE(0)Ԃ܂B + * + * ̃rfIt[łɕ\ɂȂĂ邩ǂ₢킹܂B
+ * fR[hxĂĎ̃rfIt[܂fR[hłĂȂꍇ́AĐɊ֌W + * ȂFALSEԂ܂B
+ * ‚܂肱̊֐́ũt[ GetFrameOnTime֐Ŏ擾ł邩ǂv𒲂ׂ܂B
+ * rfIt[ۂɎ擾ɂȂ΂ȂiႦ΃eNX`bNȂǁj + * ꍇ́Å֐Ńt[擾̐ۂ𔻒肵Ă珈ĂB + * + * \sa CriMvEasyPlayer::GetTime() + */ + CriBool IsNextFrameOnTime(CriError &err=CriMv::ErrorContainer); + +#if !defined(XPT_TGT_EE) + /*EN + * \ingroup MODULE_VIDEO_FRAME + * + * \brief Loads video frame data into a buffer, in 32 bit ARGB format + * \param imagebuf Pointer to output buffer + * \param pitch Pitch of output buffer, in bytes + * \param bufsize Size of output buffer, in bytes + * \param frameinfo Video frame information structure + * \param err Optional error code + * \return TRUE if a frame was retrieved + * \return FALSE otherwise + * + * Copies the next decoded frame into the 32 bit ARGB image buffer pointed to by \a imagebuf. + * If the display time is less than the frame time, or if the frame has not yet been decoded, the + * \a frameinfo parameter will be cleared and this function will return FALSE. + * + * The \a pitch parameter is the width, in bytes, of each row of the frame image, including any padding. + * + * To determine if the next frame is ready to be displayed, call CriMvEasyPlayer::IsNextFrameOnTime(). + * + * CRI Movie decodes video frames into YUV420 format internally, and stores them in frame pools (see + * CriMvEasyPlayer::SetNumberOfFramePools()) for later display. When this function is called, + * the frame must first converted to ARGB format. This can be a very CPU-intensive operation, + * especially on the PS3 and Xbox360. For 1280 x 720 video resolution, this can use almost an + * entire vsync interval. On these platforms, we recommend implementing a pixel shader and calling + * CriMvEasyPlayer::GetFrameOnTimeAsYUVBuffers() instead. + * + * \remarks
+ * If an application uses this function, an application need to call CriMv::InitializeFrame32bitARGB() + * after CriMv::Initialize(). If an application calls this function without CriMv::InitializeFrame32bitARGB() + * calling, this function failed and an error callback occurs. + * + * \remarks + * This function is not available on the PS2. + * + * \sa CriMvEasyPlayer::IsNextFrameOnTime(), CriMvEasyPlayer::GetFrameOnTimeAsYUVBuffers(), + * CriMvEasyPlayer::SetNumberOfFramePools() + */ + /*JP + * \ingroup MODULE_VIDEO_FRAME + * \brief 32bit ARGBtH[}bgł̃fR[hʂ̎擾 + * \param imagebuf o̓obt@|C^ + * \param pitch o̓obt@̃sb` [byte] + * \param bufsize o̓obt@̃TCY [byte] + * \param frameinfo 擾rfIt[̏\ + * \param err G[iȗj + * \return t[擾łꍇTRUE(1)AłȂꍇFALSE(0)Ԃ܂B + * + * 32bit ARGBtH[}bgŁA\ɂȂĂrfIt[擾܂B
+ * ̊֐Ăяoꍇ́AARGBobt@̎̂mۂŌĂяoKv܂B
+ * rfIt[͈imagebufŎw肵ARGBobt@ɏo܂B
+ * ̃rfIt[̕\ɂȂĂȂAfR[hIĂȂꍇ + * t[擾łAframeinfo̒g̓NA܂B
+ * OɃrfIt[擾ł邩ǂm肽ꍇ CriMvEasyPlayer::IsNextFrameOnTime() + * gpĂB + * + * 32bit ARGB ̎ۂ̃sNZf[^̕тɂ‚ẮÃvbgtH[ōłWI + * tH[}bgɂȂ܂B + * + * :
+ * {֐gpꍇ̓t[ϊ̏ CriMv::InitializeFrame32bitARGB()̌Ăяo + * OɕKvłBt[ϊ̏s킸ɖ{֐Ăяoꍇ̓t[擾ɎsA + * G[R[obN܂B + * + * :
+ * PS3, Xbox360 ł{֐͎gpł܂AƂĂCPUׂ̍֐ƂȂ܂B
+ * 𑜓x 1280x720 ̃[r{֐t[擾1vsync߂Ԃ܂B
+ * PS3, Xbox360 łCriMvEasyPlayer::GetFrameOnTimeAsYUVBuffers() ֐ sNZVF[_[ + * ̑gݍ킹ɂt[ϊ߂܂B
+ * + * l:
+ * PS2CRI Movie ͖{֐ɑΉĂ܂B + * + * \sa CriMvEasyPlayer::IsNextFrameOnTime() + */ + CriBool GetFrameOnTimeAs32bitARGB(CriUint8 *imagebuf, CriUint32 pitch, CriUint32 bufsize, CriMvFrameInfo &frameinfo, + CriError &err=CriMv::ErrorContainer); +#endif + +#if !defined(XPT_TGT_EE) + /*EN + * \ingroup MODULE_VIDEO_FRAME + * + * \brief Loads video frame data into a set of Y,U,V separate buffers + * \param yuvbuffers Pointer to Y,U,V buffer data structure + * \param frameinfo Video frame information structure + * \param err Optional error code + * \return TRUE if a frame was retrieved + * \return FALSE otherwise + * + * Copies the next decoded frame into the Y,U,V image buffers pointed to by \a yuvbuffers, for use + * with a pixel shader. CRI Movie decodes video frames into YUV420 format internally, so this is + * a very efficient function. + * + * If the display time is less than the frame time, or if the frame has not yet been decoded, the + * \a frameinfo parameter will be cleared and this function will return FALSE. + * + * To determine if the next frame is ready to be displayed, call CriMvEasyPlayer::IsNextFrameOnTime(). + * + * \remarks + * If the movie does not have an alpha channel, the alpha buffer fields of the \a CriMvYuvBuffers + * structure are not used. + * + * \remarks + * This function is not available on the PS2. + * + * \sa CriMvEasyPlayer::IsNextFrameOnTime() + */ + /*JP + * \ingroup MODULE_VIDEO_FRAME + * \brief YUV•ʃobt@ւ̃fR[hʂ̎擾 + * \param yuvbuffers YUV•ʃobt@̃p[^\ + * \param frameinfo 擾rfIt[̏\ + * \param err G[iȗj + * \return t[擾łꍇTRUE(1)AłȂꍇFALSE(0)Ԃ܂B + * + * YUV•ʃobt@`ŕ\ɂȂĂrfIt[擾܂B
+ * YUV•ʃobt@`̓sNZVF[_[Ńt[`悷邽߂̏o̓tH[}bgłB
+ * ̊֐Ăяoꍇ́AYUV•ʃobt@̎̂mۂŌĂяoKv܂B
+ * rfIt[͈yuvbuffersŎw肵YUV•ʃobt@ɏo܂B
+ * ̃rfIt[̕\ɂȂĂȂAfR[hIĂȂꍇ + * t[擾łAframeinfo̒g̓NA܂B
+ * OɃrfIt[擾ł邩ǂm肽ꍇ CriMvEasyPlayer::IsNextFrameOnTime() + * gpĂB
+ *
+ * At@[rĐsȂꍇ́A yuvbuffers AlphaeNX`֘Ãp[^͎gp܂B
+ * + * l:
+ * PS2CRI Movie ͖{֐ɑΉĂ܂B + * + * \sa CriMvEasyPlayer::IsNextFrameOnTime() + */ + CriBool GetFrameOnTimeAsYUVBuffers(CriMvYuvBuffers *yuvbuffers, CriMvFrameInfo &frameinfo, + CriError &err=CriMv::ErrorContainer); +#endif + +#if defined(XPT_TGT_PC) || defined(XPT_TGT_SH7269) || defined(XPT_TGT_TRGP6K) + /*EN + * \ingroup MODULE_VIDEO_FRAME + * + * \brief Loads video frame data into a buffer, in YUV422 format + * \param imagebuf Pointer to output buffer + * \param pitch Pitch of output buffer, in bytes + * \param bufsize Size of output buffer, in bytes + * \param frameinfo Video frame information structure + * \param err Optional error code + * \return TRUE if a frame was retrieved + * \return FALSE otherwise + * + * Copies the next decoded frame into the YUV422 texture buffer pointed to by \a imagebuf. + * CRI Movie decodes video frames into YUV420 format internally, so there is some internal conversion + * required when using this function. + * + * If the display time is less than the frame time, or if the frame has not yet been decoded, the + * \a frameinfo parameter will be cleared and this function will return FALSE. + * + * The \a pitch parameter is the width, in bytes, of each row of the frame image, including any padding. + * + * To determine if the next frame is ready to be displayed, call CriMvEasyPlayer::IsNextFrameOnTime(). + * + * \remarks + * This function is currently only available in the PC version of CRI Movie. + * + * \sa CriMvEasyPlayer::IsNextFrameOnTime() + */ + /*JP + * \ingroup MODULE_VIDEO_FRAME + * \brief YUV422tH[}bgł̃fR[hʂ̎擾 + * \param imagebuf o̓obt@̃|C^ + * \param pitch o̓obt@̃sb` [byte] + * \param bufsize o̓obt@TCY [byte] + * \param frameinfo 擾rfIt[̏\ + * \param err G[iȗj + * \return t[擾łꍇTRUE(1)AłȂꍇFALSE(0)Ԃ܂B + * + * YUV422eNX`tH[}bgŁA\ɂȂĂrfIt[擾܂B
+ * ̊֐Ăяoꍇ́AYUVobt@̎̂mۂŌĂяoKv܂B
+ * rfIt[͈imagebufŎw肵YUVobt@ɏo܂B
+ * ̃rfIt[̕\ɂȂĂȂAfR[hIĂȂꍇ + * t[擾łAframeinfo̒g̓NA܂B
+ * OɃrfIt[擾ł邩ǂm肽ꍇ CriMvEasyPlayer::IsNextFrameOnTime() + * gpĂB + * + * ylz
+ * ݂́APCCRI Movie ̂ݖ{֐ɑΉĂ܂B + * + * \sa CriMvEasyPlayer::IsNextFrameOnTime() + */ + CriBool GetFrameOnTimeAsYUV422(CriUint8 *imagebuf, CriUint32 pitch, CriUint32 bufsize, CriMvFrameInfo &frameinfo, + CriError &err=CriMv::ErrorContainer); +#endif + +#if defined(XPT_TGT_IPHONE) || defined(XPT_TGT_WINMO) || defined(XPT_TGT_ANDROID) || defined(XPT_TGT_CQSH2A) || defined(XPT_TGT_ACRODEA) || defined(XPT_TGT_NACL) || defined(XPT_TGT_SH7269) || defined(XPT_TGT_PC)|| defined(XPT_TGT_TRGP6K) + /*EN + * \ingroup MODULE_VIDEO_FRAME + * \brief Get video frame data to 16bit RGB565 format buffer + * + * This function is added for a prototype library for iPhone + * Please add comments when releasing the SDK. + * + */ + /*JP + * \ingroup MODULE_VIDEO_FRAME + * \brief 16bit RGB565tH[}bgł̃fR[hʂ̎擾 + * + * ̊֐iPhoneCRI Moviẽvg^Cvp̊֐錾łB + * SDKƂă[Xۂ́ARgljĉB + * + */ + CriBool GetFrameOnTimeAsRGB565(CriUint8 *imagebuf, CriUint32 pitch, CriUint32 bufsize, CriMvFrameInfo &frameinfo, + CriError &err=CriMv::ErrorContainer); +#endif + +#if defined(XPT_TGT_EE) + /*EN + * \ingroup MODULE_VIDEO_FRAME + * + * \brief Gets a reference to EasyPlayer's internal video frame buffer, in 32 bit ARGB format + * \param frameinfo Video frame information structure + * \param err Optional error code + * \return TRUE if a frame was retrieved + * \return FALSE otherwise + * + * Locks the internal buffer for the current video frame in memory, and retrieves a pointer to it. This is + * different behavior than the GetFrameXXX()functions, which copy the frame data into a caller-supplied location. + * + * On successful return from this function, the fields of \a frameinfo will be populated with information + * about the frame. In particular, the \a imageptr field will be set to the image buffer, in 32 bit ARGB format. + * After calling this function, an application must copy the video frame into its own buffer or transfer it to + * GS local memory via DMA. + * + * To determine if the next frame is ready to be displayed, call CriMvEasyPlayer::IsNextFrameOnTime(). + * + * \remarks + * After the application has copied the frame data, it must call CriMvEasyPlayer::UnlockFrame(). + * + * \remarks + * This function is only available on the PS2. + * + * \sa CriMvEasyPlayer::IsNextFrameOnTime(), CriMvEasyPlayer::UnlockFrame() + */ + /*JP + * \ingroup MODULE_VIDEO_FRAME + * \brief fR[hʗ̈(ARGB32bit)̃bNBPS2pB + * \param frameinfo bNrfIt[̏\ + * \param err G[iȗj + * + * {֐PS2p̃t[擾֐ŁA@ GetFrame ֐ɑ܂B
+ * PS2ł GetFrame ֐̑ɖ{֐ UnlockFrame ֐gpăt[擾s܂B
+ * GetFrame ֐͏o̓obt@w肵ĂփfR[hʂ擾̂ɑ΂ALockFrame ֐̓obt@w肹 + * CriMvEasyPlayernhɂfR[hʃobt@̃|C^擾Ƃ낪Ⴂ܂B
+ * + * {֐̓fR[hʂ̃̈QƊJn邽߂ɃbN܂B
+ * ̊֐Ńt[bNł̂́Ãt[\”\ԂɂȂĂꍇ݂̂łB
+ * AvP[V̓t[bNƁAfR[hʂDMAŃeNX`̈֓]邩A + * ʃobt@փRs[Ȃǂ̏s܂B
+ * fR[hʂ̎QƂIɂ́AK CriMvEasyPlayer::UnlockFrame() ֐ĂяoĎQƏIʒmĂB
+ * + * l:
+ * {֐PS2CRI Movie ̂ݑΉĂ܂B + * + * \sa CriMvEasyPlayer::IsNextFrameOnTime(), CriMvEasyPlayer::UnlockFrame() + */ + CriBool LockFrameOnTimeAs32bitARGB_PS2(CriMvFrameInfo &frameinfo, CriError &err=CriMv::ErrorContainer); +#endif + + /*EN + * \ingroup MODULE_VIDEO_FRAME + * + * \brief Unlocks the video frame + * \param frameinfo Pointer to locked video frame information + * \param err Optional error code + * + * Unlocks the video frame that was locked in memory by a call to one of the LockFrameXXX() functions. + * + * The \a frameinfo parameter must be the same one that was passed to LockFrameXXX(). + * + * If the frame has been locked, EasyPlayer will not be able to retrieve the next frame until the frame is + * unlocked. An attempt to lock the same frame more than once will fail. + * + * The LockFrameXXX() functions are CriMvEasyPlayer::LockFrameOnTimeAs32bitARGB_PS2() and + * CriMvEasyPlayer::LockFrameOnTimeAsYUVBuffers(). Depending on the platform, only one or the other of + * these functions will be available. + * + * \sa CriMvEasyPlayer::LockFrameOnTimeAs32bitARGB_PS2(), CriMvEasyPlayer::LockFrameOnTimeAsYUVBuffers() + */ + /*JP + * \ingroup MODULE_VIDEO_FRAME + * \brief bNt[Ŏ擾fR[hʂAbN + * \param frameinfo bNrfIt[̏\ + * \param err G[iȗj + * + * {֐̓bNt[֐găbNĂt[AbNAQƂ̏Iʒm܂B
+ * bNt[֐ɂ CriMvEasyPlayer::LockFrameOnTimeAs32bitARGB_PS2() CriMvEasyPlayer::LockFrameOnTimeAsYUVBuffers() + * ܂Aǂ̊֐găbNꍇA{֐găAbN܂B
+ * {֐̈ɂ́Aǂ̃t[AbN邩w邽߂ɁAbNt[֐Ŏ擾t[\̂w肵܂B
+ * + * {֐ŃAbNt[́AȌAɃrfIt[̃fR[ho̓obt@ƂĎgp܂B
+ * PxAbNt[xbN邱Ƃ͏o܂B
+ * + * \sa CriMvEasyPlayer::LockFrameOnTimeAs32bitARGB_PS2(), CriMvEasyPlayer::LockFrameOnTimeAsYUVBuffers() + */ + CriBool UnlockFrame(CriMvFrameInfo *frameinfo, CriError &err=CriMv::ErrorContainer); + +#if !defined(XPT_TGT_EE) + /*EN + * + * \brief Gets a reference to EasyPlayer's internal video frame buffer + * \param yuvbuffers Y,U,V buffer data structure + * \param frameinfo Video frame information structure + * \param err Optional error code + * \return TRUE if a frame was retrieved + * \return FALSE otherwise + * + * Locks the internal buffer for the current video frame in memory, and retrieves a pointer to it. This is + * different behavior than the GetFrameXXX() functions, which copy the frame data into a caller-supplied location. + * + * On successful return from this function, the fields of \a yuvbuffers will be set to the Y,U,V fields of the + * video frame, and the fields of \a frameinfo will be populated with information about the frame. + * + * After calling this function, an application must copy the video frame into its own buffer or transfer it to + * texture memory. + * + * To determine if the next frame is ready to be displayed, call CriMvEasyPlayer::IsNextFrameOnTime(). + * + * \remarks + * After the application has copied the frame data, it must call CriMvEasyPlayer::UnlockFrame(). + * + * \remarks + * This function is not available on the PS2. + * + * \sa CriMvEasyPlayer::IsNextFrameOnTime(), CriMvEasyPlayer::UnlockFrame() + */ + /*JP + * \ingroup MODULE_VIDEO_FRAME + * \brief fR[hʗ̈̃bN + * \param yuvbuffers YUV•ʃobt@̃p[^\ + * \param frameinfo bNrfIt[̏\ + * \param err G[iȗj + * + * GetFrame Ƃ͕ʂ̎dl̃t[擾֐łB
+ * {֐ UnlockFrame ֐ƃZbgŎgp܂B
+ * GetFrame ֐͏o̓obt@w肵ĂփfR[hʂ擾̂ɑ΂ALockFrame ֐̓obt@w肹 + * CriMvEasyPlayernhɂfR[hʃobt@̃|C^擾Ƃ낪Ⴂ܂B
+ * + * {֐̓fR[hʂ̃̈QƊJn邽߂ɃbNA + * fR[hʂYUVRނ̃obt@ɂ‚Ă̏ yuvbuffers Ɋi[܂B
+ * ̊֐Ńt[bNł̂́Ãt[\”\ԂɂȂĂꍇ݂̂łB
+ * AvP[V̓t[bNƁAfR[hʂeNX`̈փRs[邩A + * ʃobt@փRs[Ȃǂ̏s܂B
+ * fR[hʂ̎QƂIɂ́AK CriMvEasyPlayer::UnlockFrame() ֐ĂяoĎQƏIʒmĂB
+ * + * l:
+ * PS2CRI Movie ͖{֐ɑΉĂ܂B + * + * \sa CriMvEasyPlayer::UnlockFrame() + */ + CriBool LockFrameOnTimeAsYUVBuffers(CriMvYuvBuffers &yuvbuffers, CriMvFrameInfo &frameinfo, + CriError &err=CriMv::ErrorContainer); +#endif + + /*EN + * \ingroup MODULE_VIDEO_FRAME + * + * \brief Discards the next video frame + * \param frameinfo Discarded frame information structure + * \param err Optional error code + * \return TRUE if a frame was available to discard + * \return FALSE otherwise + * + * Discards the next video frame, if it is available, and populates \a frameinfo with information about + * the frame. Note that the \a imageptr field of that structure will not be available and should not + * be referenced. + * + * To determine if the next frame is ready to be displayed, call CriMvEasyPlayer::IsNextFrameOnTime(). + * + * \sa CriMvEasyPlayer::IsNextFrameOnTime() + */ + /*JP + * \ingroup MODULE_VIDEO_FRAME + * \brief t[擾Ɏ̂Ă + * \param frameinfo jrfIt[̏\ + * \param err G[iȗj + * + * fR[hς݂̃rfIt[̂ĂꍇɎgp֐łB
+ * t[擾֐ƔׂƁAo͗pobt@KvłB
+ * CriMvEasyPlayer::IsNextFrameOnTime()Ŏt[擾ł邱ƂmFA{֐ĂяoĂB
+ * frameinfoɂ͎Ql̂߂ɔjrfIt[̏񂪊i[܂AfR[hʎ̂ɂ̓ANZXł܂B + * + * \sa CriMvEasyPlayer::IsNextFrameOnTime() + */ + CriBool DiscardNextFrame(CriMvFrameInfo &frameinfo, CriError &err=CriMv::ErrorContainer); + + /*EN + * \ingroup MODULE_OPTION + * + * \brief Sets the current channel for displaying subtitles + * + * \param channel Subtitle channel number + * \param err Optional error code + * + * A movie can contain up to 16 distinct sets of subtitles, each on its own display channel. This can + * be used, for instance, to provide multilanguage support. + * + * Subtitle channels are numbered sequentially, starting from 0, but do not need to be contiguous. + * For example, a movie can have 3 sets of subtitles, on channels 1, 5, and 7. The number of channels + * can be determined once CriMvEasyPlayer::GetMovieInfo() has completed successfully by looking at the + * \a num_subtitle field of the \a CriMvStreamingParameters structure passed to that function. + * + * By default, subtitle playback is off. To turn off subtitles once they have been turned on, pass + * CRIMV_SUBTITLE_CHANNEL_OFF as the value of \a channel. + * + * If the selected subtitle channel does not exist, subtitles will not be displayed. + * + * \remarks + * If an application turns on subtitle display with this function, it must periodically call + * CriMvEasyPlayer::GetSubtitleOnTime(), or else movie playback will stall. + * + * \sa CriMvEasyPlayer::GetMovieInfo(), CriMvEasyPlayer::DecodeHeader(), CriMvEasyPlayer::GetSubtitleOnTime() + */ + /*JP + * \ingroup MODULE_OPTION + * \brief 擾鎚`l̐ݒ + * \param channel `l + * \param err G[iȗj + * + * 擾鎚`lݒ肵܂BftHg͎擾łB + * + * CriMvEasyPlayer::DecodeHeader() CriMvEasyPlayer::GetMovieInfo()gƂŁAĐ郀[r + * ‚̎܂ł邩ĐJnOɒm邱Ƃł܂B + * + * f[^݂Ȃ`lԍw肵ꍇ́A͎擾ł܂B
+ * ftHgݒi擾jɂꍇ́A`lƂCRIMV_SUBTITLE_CHANNEL_OFFw肵ĂB + * + * ̊֐Ŏ`lw肵ꍇ́AC[vI CriMvEasyPlayer::GetSubtitleOnTime() + * sĂB擾IɍsȂꍇ́A[rĐrŎ~܂܂B + * + * \sa CriMvEasyPlayer::GetMovieInfo(), CriMvEasyPlayer::DecodeHeader(), CriMvEasyPlayer::GetSubtitleOnTime + */ + void SetSubtitleChannel(CriSint32 channel, CriError &err=CriMv::ErrorContainer); + + /*EN + * \ingroup MODULE_VIDEO_FRAME + * + * \brief Retrieves subtitle data for the current frame, if available + * + * \param bufptr Buffer to receive subtitle data + * \param bufsize Size of buffer, in bytes + * \param err Optional error code + * + * \return The number of bytes copied into \a bufptr + * + * If the movie contains subtitle data, and there is a subtitle for the current frame, up to \a bufsize + * bytes of the subtitle data for the active subtitle channel will be copied into \a bufptr. Otherwise, + * the entire buffer will be filled with zeroes. + * + * \remarks + * If an application turns on subtitle display with CriMvEasyPlayer::SetSubtitleChannel(), it must + * periodically call this function, or else movie playback will stall. + * + * \remarks + * An application should not make assumptions as to whether the returned data is NUL-terminated. + * + * \sa CriMvEasyPlayer::SetSubtitleChannel() + */ + /*JP + * \ingroup MODULE_VIDEO_FRAME + * \brief f[^̎擾 + * \param bufptr o̓obt@|C^ + * \param bufsize o̓obt@TCY [byte] + * \param err G[iȗj + * \return 擾f[^̃TCY[byte]Ԃ܂B + * + * \ɂȂĂ鎚f[^擾܂B + * ̊֐Ăяoꍇ́Apobt@̎̂mۂŌĂяoĂB
+ * f[^͈ bufptr Ŏw肵obt@ɏo܂B
+ * f[^ bufsize 傫ꍇ́Abufsize Ɏ܂ʂoAc͔j܂B + * + * \̎ꍇ́Aobt@̒g̓NA܂B + * + * CriMvEasyPlayer::SetSubtitleChannel()ő݂鎚`lw肵Ăꍇ́A + * C[vIɖ{֐sĂB
+ * sȂꍇ́A[rĐrŎ~܂܂B + * + * \sa CriMvEasyPlayer::SetSubtitleChannel() + */ + CriUint32 GetSubtitleOnTime(CriUint8 *bufptr, CriUint32 bufsize, CriError &err=CriMv::ErrorContainer); + + /*EN + * \ingroup MODULE_OPTION + * + * \brief Sets a secondary sound interface + * + * \param sound Secondary sound interface to attach to this handle + * \param err Optional error code + * + * A subaudio interface allows an application to play two audio tracks at the same time. This is + * typically used to play a dialog track or sound effects along with background music. After calling + * this function, an application needs to call CriMvEasyPlayer::SetSubAudioTrack() to choose the secondary + * audio track to play. + * + * Note that you must create a separate sound interface to pass to this function. The interface used + * in the CriMvEasyPlayer::Create() call can not be used. + * + * If a subaudio interface is used, the application must call CriMvEasyPlayer::DetachSubAudioInterface() + * when the EasyPlayer handle reaches the MVEASY_STATUS_STOP or MVEASY_STATUS_PLAYEND state before calling + * CriMvEasyPlayer::Destroy(). + * + * Calling CriMvEasyPlayer::ResetAllParameters() will not affect the value set by this function. + * + * \remarks + * If this function is called, it must be called before starting playback (with either CriMvEasyPlayer::Prepare() + * or CriMvEasyPlayer::Start()). + * + * \remarks + * An EasyPlayer handle can not use a subaudio interface and center channel replacement (see + * CriMvEasyPlayer::ReplaceCenterVoice()) at the same time. + * + * \sa CriMvEasyPlayer::DetachSubAudioInterface(), CriMvEasyPlayer::SetSubAudioTrack(), + * CriMvEasyPlayer::ReplaceCenterVoice() + */ + /*JP + * \ingroup MODULE_OPTION + * \brief TuI[fBIpTEhC^tF[X̐ݒ + * \param sound TuI[fBIpTEhC^tF[X + * \param err G[iȗj + * + * TuI[fBIiCI[fBIƓɕʂ̃I[fBIĐ@\ĵ߂ + * TEhC^tF[Xݒ肵܂B
+ * ݒ肷TEhC^tF[X́A CriMvEasyPlayer::Create() Ɏw肵TEhC^tF[X + * Ƃ́uʂ́vCX^XłȂ΂܂B
+ * + * {֐́AEasyPlayernh쐬A CriMvEasyPlayer::Start() ܂ CriMvEasyPlayer::Prepare() + * ĂяoOɎsȂ΂܂B
+ * + * TuI[fBIĐɂ́A{֐ŃTEhC^tF[Xݒ肵ƁA + * CriMvEasyPlayer::SetSubAudioTrack() ŃTuI[fBĨgbNw肵ĂB
+ * + * TuI[fBIpTEhC^tF[Xݒ肵nhjjOɁA + * MVEASY_STATUS_STOP ܂ MVEASY_STATUS_PLAYEND ̏Ԃ CriMvEasyPlayer::DetachSubAudioInterface() ĂłB + * ȂATuI[fBIpTEhC^tF[X CriMvEasyPlayer::ResetAllParameters() ĂяoĂZbg܂B + * + * :
+ * TuI[fBI@\́A CriMvEasyPlayer::ReplaceCenterVoice() ɂZ^[`lu@\Ƃ + * Ɏgpł܂B
+ * + * \sa CriMvEasyPlayer::DetachSubAudioInterface(), CriMvEasyPlayer::SetSubAudioTrack(), + * CriMvEasyPlayer::ReplaceCenterVoice() + */ + void AttachSubAudioInterface(CriMvSoundInterface *sound, CriError &err=CriMv::ErrorContainer); + + /*EN + * \ingroup MODULE_OPTION + * + * \brief Removes a secondary audio interface + * + * \param err Optional error code + * + * Removes the secondary sound interface that was set by a call to CriMvEasyPlayer::AttachSubAudioInterface(). + * + * This function should be called when the EasyPlayer handle's state is either MVEASY_STATUS_STOP or + * MVEASY_STATUS_PLAYEND. + * + * \sa CriMvEasyPlayer::AttachSubAudioInterface() + */ + /*JP + * \ingroup MODULE_OPTION + * \brief TuI[fBIpTEhC^tF[X̉ + * \param err G[iȗj + * + * ݐݒ肳ĂTuI[fBIpTEhC^tF[X܂B
+ * + * {֐́AEasyPlayernh̏Ԃ CriMvEasyPlayer::MVEASY_STATUS_STOP ܂ + * CriMvEasyPlayer::MVEASY_STATUS_PLAYEND ̎ɌĂяoĂB
+ * + * \sa CriMvEasyPlayer::AttachSubAudioInterface() + */ + void DetachSubAudioInterface(CriError &err=CriMv::ErrorContainer); + + /*EN + * \ingroup MODULE_OPTION + * + * \brief Sets the secondary audio track + * + * \param track Track number + * \param err Optional error code + * + * A secondary, or subaudio, track is typically used to play a dialog track or sound effects along + * with a movie. An application can support several different languages by setting the desired language + * track with this function. By default, the subaudio track is disabled, even if the interface has been set. + * + * Subaudio is enabled with CriMvEasyPlayer::AttachSubAudioInterface(). If the interface has not been set, + * this function will have no effect. + * + * The main audio track for the movie is set with CriMvEasyPlayer::SetAudioTrack(). If the same track + * number is used for the main and subaudio, the subaudio will not play. + * + * To turn off the subaudio track, pass CRIMV_CENTER_VOICE_OFF as the track number. + * + * \remarks + * If this function is called, it must be called before starting playback (with either CriMvEasyPlayer::Prepare() + * or CriMvEasyPlayer::Start()). + * + * \remarks + * An EasyPlayer handle can not use a subaudio interface and center channel replacement (see + * CriMvEasyPlayer::ReplaceCenterVoice()) at the same time. + * + * \sa CriMvEasyPlayer::AttachSubAudioInterface(), CriMvEasyPlayer::ReplaceCenterVoice() + */ + /*JP + * \ingroup MODULE_OPTION + * \brief TuI[fBIgbN̐ݒ + * \param track TuI[fBIĐgbNԍ + * \param err G[iȗj + * + * TuI[fBIgbNݒ肵܂BftHgl CRIMV_CENTER_VOICE_OFF łB
+ * + * TuI[fBIĐɂ́A CriMvEasyPlayer::AttachSubAudioInterface() ŃTEhC^tF[Xݒ肵ƁA + * {֐ŃTuI[fBĨgbNw肵ĂB
+ * {֐̌ĂяóA CriMvEasyPlayer::Start() ܂ CriMvEasyPlayer::Prepare() ̌ĂяoOłȂ΂܂B
+ * + * CI[fBĨgbN CriMvEasyPlayer::SetAudioTrack() Ŏw肵܂B + * TuI[fBIgbNƂăCI[fBIƓgbNw肵ꍇ́ATuI[fBI͉Đ܂B
+ * + * TuI[fBIgbNɂ́AZ^[`lu@\Ƃ͈قȂ`l̐͂܂B + * mAXeIA5.1ch ̂̃gbNTuI[fBIƂĎgp邱Ƃł܂B
+ * + * :
+ * TuI[fBI@\́A CriMvEasyPlayer::ReplaceCenterVoice() ɂZ^[`lu@\Ƃ + * Ɏgpł܂B
+ * + * \sa CriMvEasyPlayer::AttachSubAudioInterface() + */ + // default value is -1. + void SetSubAudioTrack(CriSint32 track, CriError &err=CriMv::ErrorContainer); + + /*EN + * \ingroup MODULE_OPTION + * + * \brief Retrieves the secondary audio track + * + * \param err Optional error code + * \return track number Current subaudio track number + * + * When you successfully set the subaudio track, this function return the track number + * that you specified by CriMvEasyPlayer::SetSubAudioTrack(). Otherwise, it retuns CRIMV_CENTER_VOICE_OFF. + * + * \sa CriMvEasyPlayer::SetSubAudioTrack() + */ + /*JP + * \ingroup MODULE_OPTION + * \brief TuI[fBIgbN̎擾 + * \param err G[iȗj + * \return gbNԍ ݐݒ肳ĂgbNԍ + * + * TuI[fBIĐLɂȂĂ΁A[UCriMvEasyPlayer::SetSubAudioTrack()Őݒ肵 + * TuI[fBIgbNԍԂ܂B + * + * TuI[fBIĐLłȂꍇATuI[fBIgbNw肵ĂȂꍇ́A + * CRIMV_CENTER_VOICE_OFFԂ܂B + * + * \sa CriMvEasyPlayer::SetSubAudioTrack() + */ + CriSint32 GetSubAudioTrack(CriError &err=CriMv::ErrorContainer); + + /*EN + * \ingroup MODULE_OPTION + * + * \brief Replaces the center channel of a 5.1ch audio track + * + * \param track Track number to use + * \param err Optional error code + * + * If the current audio track for a movie (set with CriMvEasyPlayer::SetAudioTrack()) is in 5.1ch + * surround sound, the center channel can be replaced with a different, mono, track. This does not + * affect any of the other channels in the 5.1ch track. + * + * If the current audio track is not 5.1ch, or the replacement track is not monaural, this call will + * have no effect. + * + * Passing CRIMV_CENTER_VOICE_OFF as the value of \a track will undo the replacement and revert to + * playing the original center channel of th 5.1ch track. + * + * \remarks + * An EasyPlayer handle can not use center channel replacement and a subaudio interface (see + * CriMvEasyPlayer::AttachSubAudioInterface() and CriMvEasyPlayer::SetSubAudioTrack()) at the same time. + * + * \sa CriMvEasyPlayer::SetAudioTrack(), CriMvEasyPlayer::AttachSubAudioInterface(), + * CriMvEasyPlayer::SetSubAudioTrack() + */ + /*JP + * \ingroup MODULE_OPTION + * \brief Z^[{CX̐ݒ + * \param track {CXgbNԍ + * \param err G[iȗj + * + * 5.1ch I[fBIĐɁAZ^[`lʂ̃mgbNƒu邱Ƃł܂B
+ * {֐́Aup̃mf[^I[fBIgbNݒ肵܂B
+ * 5.1ch BGM ɑ΂āA{CX𕡐ނ獷ւꍇɎgpĂB + * + * ftHg̓Z^[{CXw薳łB + * + * ̊֐gpꍇAC̃I[fBIgbNƂčĐĂ5.1chf[^̃Z^[`l + * ͔jAɃZ^[{CXƂĎw肵f[^܂B + * + * (a) Z^[{CXƂĎgpł̂̓m̃I[fBIłB
+ * (b) Z^[uLȂ̂̓C̃I[fBI5.1ch̏ꍇłB + * + * ̓‚̏𖞂ĂȂꍇ́A{֐Őݒ肵l͖܂B + * + * ftHglɖ߂ꍇ́A`lƂCRIMV_CENTER_VOICE_OFFw肵ĂB + * + * \sa CriMvEasyPlayer::SetAudioTrack(), CriMvEasyPlayer::AttachSubAudioInterface(), + * CriMvEasyPlayer::SetSubAudioTrack() + */ + void ReplaceCenterVoice(CriSint32 track, CriError &err=CriMv::ErrorContainer); + + /*EN + * \ingroup MODULE_OPTION + * + * \brief Sets a callback function that will set the movie file + * + * \param func Callback function + * \param usrobj Pointer to user-provided data + * \param err Optional error code + * + * Normally, the movie file is provided directly, via CriMvEasyPlayer::SetFile() or + * CriMvEasyPlayer::SetData(), before playback is started. Setting a file request callback + * allows an application to do \a concatenated \a playback, playing multiple movies, one + * after the other. + * + * If the callback function is set, it will be called when + * + * - The last data chunk of the current movie has been read by EasyPlayer. + * - Any of the playback functions (CriMvEasyPlayer::Start(), CriMvEasyPlayer::Prepare(), + * or CriMvEasyPlayer::DecodeHeader()) are called and the movie file has not been set. + * + * The callback should call CriMvEasyPlayer::SetFile() or CriMvEasyPlayer::SetData() if the + * application wants to continue playback. Otherwise, playback will end once the callback returns. + * + * The \a usrobj parameter specifies a pointer to arbitrary data, that will be passed as the + * second parameter to the callback. + * + * The prototype of the callback function is + * + * void callback(CriMvEasyPlayer *mveasy, void *usrobj) + * + * where + * + * mveasy is the EasyPlayer object + * usrobj is the pointer to user data that was passed to SetFileRequestCallback(). + * + * \remarks + * In order to do concatenated playback, all movies must have the same + * + * \remarks + * - video resolution + * - framerate + * - video codec + * - audio track structure + * - subtitle structure + * + * \remarks + * The same audio track structure means that all movies must have the same number of tracks, and the + * same track number must be of the same audio type for each movie. For instance, if the first movie has + * 2 audio tracks, with track 1 being stereo and track 2 being mono, then \a all other movies would have + * to have 2 tracks, track 1 stereo and track 2 mono. + * + * \remarks + * Subtitles have to match in the number of channels. For instance, if the first movie had 3 subtitle + * channels, then all other movies would need 3 channels. It is also important to keep the languages on + * the same tracks for each movie, since otherwise the application would get confused. CRI Movie makes + * no assumptions about languages or the interpretation of subtitles; subtitles are simply treated as + * binary data. + * + * \remarks + * Currently, cuepoints are not supported with concatenated playback. + * + * \sa CriMvEasyPlayer::SetFile(), CriMvEasyPlayer::SetData() + */ + /*JP + * \ingroup MODULE_OPTION + * \brief t@CvR[obN֐̓o^ + * \param func t@CvR[obN֐ + * \param usrobj [UIuWFNg + * \param err G[iȗj + * + * [r̘AĐs߂ɁA[rt@CvR[obN֐o^܂B + * ̃R[obN֐͈ȉ̃^C~OŔ܂B + * + * E[rt@CǂݍݏIB
+ * Et@C̎w薳ōĐJnB + * + * t@CvR[obN֐ CriMvEasyPlayer::SetFile() ܂ CriMvEasyPlayer::SetData() + * ĂяoƂŁAAĎ̃[rt@Cw肷邱Ƃł܂B
+ * SetFile() SetData() ĂяoȂꍇ́Aǂݍݍς݂̃[rI + * ĐIɂȂ܂B + * + * t@CvR[obNAR[obN֐̑usrobjɂ́Ao^Ɏw + * [UIuWFNgn܂Bo^t@CXgȂǂ̊ǗɗpĂB + * + * AĐł郀[rt@Cɂ͈ȉ̏܂B
+ * - rfI𑜓x + * - rfĨt[[g + * - rfĨR[fbN + * - I[fBIю̃gbN\ + * + * \sa CriMvEasyPlayer::SetFile(), CriMvEasyPlayer::SetData() + */ + void SetFileRequestCallback(void (*func)(CriMvEasyPlayer *mveasy, void *usrobj), + void *usrobj, CriError &err=CriMv::ErrorContainer); + +#if defined(XPT_TGT_PC) + /*EN + * \ingroup MODULE_OPTION + * \brief Set processor parameters for decoding on PC + * + * \param num_threads Number of additional threads for load distribution in decoding (Maximum 3 threads) + * \param affinity_mask Pointer to an array of thread affinity masks for each thread specified with num_threads. + * \param priority Thread priority of the decoding threads for load balancing + * \param err Optional error code + * + * This function sets the processor parameters for decoding. Use it when you want to change + * processors or thread priority for decoding load distribution. + * + * If this function is called, it must be called before calling any of the playback functions + * (CriMvEasyPlayer::Start(), CriMvEasyPlayer::Prepare(), or CriMvEasyPlayer::DecodeHeader()). + * + * On initialization, CRI Movie prepares three worker threads for distributed decoding.
+ * + * \a num_threads specifies how many worker threads CRI Movie should use.
+ * \a affinity_mask is an array of affinity masks for the worker threads. This array must have + * \a num_threads many elements. The format of \a affinity_mask is same as for the value passed to the + * Win32 SetThreadAffinityMask() API function.
+ * \a priority is used as the thread priority for all of the threads specified by \a num_threads. + * + * If this function is called, three distributed decoding threads will run in parallel by default. + * Also, processor assignment of the decoding threads is handled by the operating system, and their + * priority will be normal. + * + * To reset the parameters, call this function again, passing CRIMV_DEFAULT_AFFNITY_MASK_PC and + * CRIMV_DEFAULT_THREAD_PRIORITY_PC as the affinity masks and thread priority. + * + * \sa CRIMV_DEFAULT_AFFNITY_MASK_PC, CRIMV_DEFAULT_THREAD_PRIORITY_PC + */ + /*JP + * \ingroup MODULE_OPTION + * \brief PCŃfR[hɎgljvZbTݒ + * \param num_threads וUfR[hpɎgpljXbh̐ (őRj + * \param affinity_masks XbhAtBjeB}XN̔zւ̃|C^Bnum_threadsŎw肵XbhƂ̃}XNlB + * \param priority וUfR[hXbh̗Dx + * \param err G[iȗj + * + * fR[h𕪎Uď邽߂̃vZbTwł܂B + * fR[hɍsvZbTXbhDxύXꍇɎgpĂB + * {֐͍ĐJn(Start, Prepare, DecodeHader)OɌĂяoKv܂B + * + * CRI Movie͏̍ۂɂR‚̕UfR[hp̃[J[Xbhpӂ܂B + * num_threadsŁÂ̂‚̃XbhۂɎgp邩wł܂B + * AvP[V疾IɃvZbT蓖ĂsꍇAX̃Xbhɑ΂ + * AtBjeB}XNݒ肵ĂB + * AtBjeB}XN̒ĺAWin32 APISetThreadAffinityMask̈ƓłB + * XbhDx́Anum_threadsŎw肵fR[hɎgpXbhɑ΂ēKp܂B + * + * ̊֐Ă΂ȂꍇAR‚̃XbhŕfR[hs܂B + * fR[hXbh̃vZbT͊蓖Ă͑SOSCŁADx̓XbhWɂȂ܂B + * + * x{֐ŐݒύXAԂ߂ꍇ́ACRIMV_DEFAULT_AFFNITY_MASK_PC, CRIMV_DEFAULT_THREAD_PRIORITY_PC + * ƂĎw肵AēxĂяoĂB + * + * \sa CRIMV_DEFAULT_AFFNITY_MASK_PC, CRIMV_DEFAULT_THREAD_PRIORITY_PC + */ + void SetUsableProcessors_PC(CriSint32 num_threads, const CriUint32 *affinity_mask, CriSint32 priority, + CriError &err=CriMv::ErrorContainer); + +#endif + +#if defined(XPT_TGT_XBOX360) + /*EN + * \ingroup MODULE_OPTION + * \brief Set processor parameters for decoding + * \param processors_param Processor Parameters + * \param err Optional error code + * + * \brief Set processor parameters for decoding + * \param processors_param Processor Parameters + * \param err Optional error code + * + * This function sets the processor parameters for decoding, along the priority of the + * decoding threads. + * + * If this function is called, it must be called before calling any of the playback functions + * (CriMvEasyPlayer::Start(), CriMvEasyPlayer::Prepare(), or CriMvEasyPlayer::DecodeHeader()). + * + * If you don't call this function, the EasyPlayer handle uses Processor 3 (Core 0, Thread 0) + * and Processor 5 (Core 0, Thread 0). + * + * \sa CriMvProcessorParameters_XBOX360 + */ + /*JP + * \ingroup MODULE_OPTION + * \brief Xbox360ŃfR[hɎgvZbTݒ + * \param processors_param gpvZbTp[^ + * \param err G[iȗj + * + * fR[hɎgpvZbTw肵܂B
+ * {֐͍ĐJn(Start, Prepare, DecodeHader)OɌĂяoKv܂B + * + * ܂AfR[hɎgpXbh̗Dx̐ݒ肪o܂B + * + * ftHg̃vZbTݒł́AvZbTR(RA1Xbh1)ƃvZbTT + * (RA2Xbh1)gp܂B + * + * \sa CriMvProcessorParameters_XBOX360 + */ + void SetUsableProcessors_XBOX360(const CriMvProcessorParameters_XBOX360 *processors_param, + CriError &err=CriMv::ErrorContainer); +#endif + + /*EN + * \ingroup MODULE_OPTION + * + * \brief Sets the frame where playback will start + * + * \param seek_frame_id Frame (0-based) to start playing from + * \param err Optional error code + * + * To play a movie from other than the first frame, call this function before starting playback. + * To seek to a new frame when the movie is already playing, call CriMvEasyPlayer::Stop() and wait + * for the handle to change to the MVEASY_STATUS_STOP state, call this function with the desired + * frame number, then call CriMvEasyPlayer::Start() again. + * + * Valid values for seek_frame_id are from 0 to \a num_frames - 1, where \a num_frames can be found by + * + *
+	 *
+	 *   CriMvStreamingParameters streaming_params;
+	 *   CriSint32                num_frames;
+	 *
+	 *   GetMovieInfo(streaming_params);
+	 *   num_frames = streaming_params.video_prm[0].total_frames;
+	 *
+	 * 
+ * + * Refer to \ref usr_mech7 for more information. + * + * \remarks + * If the value of \a seek_frame_id is out of range, playback will start from frame 0. + * + * \sa CriMvStreamingParameters + */ + /*JP + * \ingroup MODULE_OPTION + * \brief V[NĐJnʒu̐ݒ + * \param seek_frame_id V[NĐJnt[ԍiO`j + * \param err G[iȗj + * + * V[NĐJnt[ԍw肵܂B + * + * ĐJnO( CriMvEasyPlayer::Prepare()܂ CriMvEasyPlayer::Start()ĂяoO)ɖ{֐sĂB + * ܂Å֐̓[r̍ĐɌĂяoƂ͏o܂BĐɃV[Nꍇ́AxĐ~Ă + * {֐ĂяoĂB + * + * {֐sȂꍇA܂̓t[ԍOw肵ꍇ̓[r̐擪ĐJn܂B + * w肵t[ԍA[rf[^̑t[傫蕉̒lꍇ[r̐擪Đ܂B + * + * \ref usr_mech7 킹ĎQƂĂB + * + */ + void SetSeekPosition(CriSint32 seek_frame_id, CriError &err=CriMv::ErrorContainer); + + /*EN + * + * \brief Calculates a frame ID from a frame time + * + * \param count Timer counter + * \param unit Counter increment per second + * \param err Optional error code + * + * \return Frame ID corresponding to given time + * + * Each frame of a movie corresponds to a particular display time, based on the framerate. Given a + * time from the start of playback, this function will return the ID of the specific frame that should + * be displayed, barring any delays or skipped frames, at that time. + * + * The time, in seconds, is specified by \a count / \a unit.
+ * + * This function can be used for, among other things, jumping to a particular frame when a cuepoint is reached. + * + * \remarks + * This function can be called once the EasyPlayer handle status has reached MVEASY_STATUS_WAIT_PREP. + * + * \sa CriMvEasyPlayer::CalcTimeFromFrameId(); + */ + /*JP + * \ingroup MODULE_OPTION + * \brief Đt[ԍ̌vZ + * \param count ^C}JEg + * \param unit Pb̃^C}JEglBcount unit ŕbPʂ̎ƂȂ܂B + * \param err G[iȗj + * \return frame ID + * + * Đt[ԍvZ܂B + * ̊֐́AEasyPlayernh̏Ԃ MVEASY_STATUS_WAIT_PREP ȍ~ɂȂƂɎgpł܂B + * + * V[NĐJnʒuAvZƂɎgpĂB + * iႦ΃L[|Cg񂩂V[Nʒu肷ꍇȂǁBj + * + * \sa CriMvEasyPlayer::CalcTimeFromFrameId(); + */ + CriSint32 CalcFrameIdFromTime(CriUint64 count, CriUint64 unit, CriError &err=CriMv::ErrorContainer); + + /*EN + * \ingroup MODULE_OPTION + * + * \brief Calculates a frame time from a frame ID + * + * \param frame_id Frame ID + * \param unit Counter increment per second + * \param err Optional error code + * + * \return Timer counter corresponding to given frame ID + * + * Each frame of a movie corresponds to a particular display time, based on the framerate. Given a + * frame ID and the number of timer intervals per second, this function will return the timer count + * of the display time for that frame. + * + * The display time, in seconds, for this frame is calculated by dividing the timer count by the timer + * interval. + * + * If you have the movie frame, you do not have to calculate the time. The \a time and \a tunit fields + * of the CriMvFrameInfo structure that is passed the GetFrameOnTimeXXX() and DiscardNextFrame() + * functions will contain this information. + * + * \remarks + * This function can be called once the EasyPlayer handle status has reached MVEASY_STATUS_WAIT_PREP. + * + * \sa CriMvEasyPlayer::CalcFrameIdFromTime(), CriMvFrameInfo + */ + /*JP + * \ingroup MODULE_OPTION + * \brief t[ԍĐ̌vZ + * \param frame_id frame ID + * \param unit Pb̃^C}JEglBcount unit ŕbPʂ̎ƂȂ܂B + * \param err G[iȗj + * \return ^C}JEg + * + * t[ԍĐvZ܂B + * ̊֐́AEasyPlayernh̏Ԃ MVEASY_STATUS_WAIT_PREP ȍ~ɂȂƂɎgpł܂B + * + * ۂɃt[擾ꍇ́AvZ̕Kv͂܂Bt[\̂̎QƂĂB + * + * \sa CriMvEasyPlayer::CalcFrameIdFromTime(), CriMvFrameInfo + */ + CriUint64 CalcTimeFromFrameId(CriSint32 frame_id, CriUint64 unit, CriError &err=CriMv::ErrorContainer); + + /*EN + * \ingroup MODULE_OPTION + * + * \brief Find the next event point, if any, after the given time counter + * + * \param count Timer counter + * \param unit Counter increment per second + * \param type Type of event point to look for + * \param eventinfo Returned event point information structure + * \param err Optional error code + * + * \return Frame ID corresponding to given time + * + * Event points allow an application to associate arbitrary actions with specific points in a movie. + * This function will search forward in the movie for the next event point after the given time + * (specifed as \a count / \a unit). If an event point is found, \a eventinfo will be populated with + * the information about the event point, and the function will return the corresponding frame ID. + * + * \a type is an application-defined value that can be used to categorize event points, and is specified + * when the movie is encoded (see link to event-point-specification-section for more information + * about creating event points.). If -1 is passed as the value of \a type, all event points will be + * searched. Otherwise, only matching event point types will be searched. + * + * If no event point of the requested type is found, this function will return -1. + * + * \remarks + * This function can be called once the EasyPlayer handle status has reached MVEASY_STATUS_WAIT_PREP. + * + * \sa CriMvEasyPlayer::SearchPrevEventPointByTime(); + */ + /*JP + * \ingroup MODULE_OPTION + * \brief w莞̃Cxg|Cǧ + * \param count ^C}JEg + * \param unit Pb̃^C}JEglBcount unit ŕbPʂ̎ƂȂ܂B + * \param type ΏۂƂCxg|Cgtypel + * \param eventinfo Cxg|Cg̏ + * \param err G[iȗj + * \return frame ID + * + * w莞̎ɂCxg|CgACxg|Cgƃt[ԍ擾܂B + * ̊֐́AEasyPlayernh̏Ԃ MVEASY_STATUS_WAIT_PREP ȍ~ɂȂƂɎgpł܂B + * + * ̑ΏۂƂȂ̂ type Ŏw肵lvCxg|CgłB + * type -1w肵ꍇ́ASẴCxg|CgΏۂƂȂ܂B + * + * ΏۂƂȂCxg|CgłȂꍇ́At[ԍ-1Ԃ܂B + * + * \sa CriMvEasyPlayer::SearchPrevEventPointByTime(); + */ + CriSint32 SearchNextEventPointByTime(CriUint64 count, CriUint64 unit, CriSint32 type, + CriMvEventPoint &eventinfo, CriError &err=CriMv::ErrorContainer); + + /*EN + * \ingroup MODULE_OPTION + * + * \brief Find the previous event point, if any, before the given time counter + * + * \param count Timer counter + * \param unit Counter increment per second + * \param type Type of event point to look for + * \param eventinfo Returned event point information structure + * \param err Optional error code + * + * \return Frame ID corresponding to given time + * + * Event points allow an application to associate arbitrary actions with specific points in a movie. + * This function will search backward in the movie (i.e. towards the beginning) for the next event + * point before the given time (specifed as \a count / \a unit). If an event point is found, + * \a eventinfo will be populated with the information about the event point, and the function will + * return the corresponding frame ID. + * + * \a type is an application-defined value that can be used to categorize event points, and is specified + * when the movie is encoded (see link to event-point-specification-section for more information + * about creating event points.). If -1 is passed as the value of \a type, all event points will be + * searched. Otherwise, only matching event point types will be searched. + * + * If no event point of the requested type is found, this function will return -1. + * + * \remarks + * This function can be called once the EasyPlayer handle status has reached MVEASY_STATUS_WAIT_PREP. + * + * \sa CriMvEasyPlayer::SearchNextEventPointByTime(); + */ + /*JP + * \ingroup MODULE_OPTION + * \brief w莞ÕCxg|Cǧ + * \param count ^C}JEg + * \param unit Pb̃^C}JEglBcount unit ŕbPʂ̎ƂȂ܂B + * \param type ΏۂƂCxg|Cgtypel + * \param eventinfo Cxg|Cg̏ + * \param err G[iȗj + * \return frame ID + * + * w莞̎OɂCxg|CgACxg|Cgƃt[ԍ擾܂B + * ̊֐́AEasyPlayernh̏Ԃ MVEASY_STATUS_WAIT_PREP ȍ~ɂȂƂɎgpł܂B + * + * ̑ΏۂƂȂ̂ type Ŏw肵lvCxg|CgłB + * type -1w肵ꍇ́ASẴCxg|CgΏۂƂȂ܂B + * + * ΏۂƂȂCxg|CgłȂꍇ́At[ԍ-1Ԃ܂B + * + * \sa CriMvEasyPlayer::SearchNextEventPointByTime(); + */ + CriSint32 SearchPrevEventPointByTime(CriUint64 count, CriUint64 unit, CriSint32 type, + CriMvEventPoint &eventinfo, CriError &err=CriMv::ErrorContainer); + + /*EN + * \ingroup MODULE_OPTION + * + * \brief Gets the list of all event points in the movie + * + * \param err Optional error code + * + * \return Pointer to the list of event points, or NULL if there are no event points + * + * CRI Movie considers a cue point list to be the number of event points in a movie, and a pointer to + * an array of event point structures. Event points allow an application to associate arbitrary actions + * with specific points in a movie. + * + * The returned pointer points to an area inside of the EasyPlayer's work buffer. An application should + * not attempt to write to it. + * + * \remarks + * This function can be called once the EasyPlayer handle status has reached MVEASY_STATUS_WAIT_PREP. + * The returned information is valid through the MVEASY_STATUS_STOP state. Once the EasyPlayer handle + * has been destroyed, or the movie has been restarted (by calling CriMvEasyPlayer::Start(), + * CriMvEasyPlayer::Prepare(), or CriMvEasyPlayer::DecodeHeader()), the cuepoint information will be + * invalid. + * + */ + /*JP + * \ingroup MODULE_OPTION + * \brief L[|CgiCxg|Cgꗗj̎擾 + * \param err G[iȗj + * \return Cue point info (Event point list) + * + * L[|CgiCxg|Cgꗗj擾܂B + * ̊֐́AEasyPlayernh̏Ԃ MVEASY_STATUS_WAIT_PREP ȍ~ɂȂƂɎgpł܂B + * + * ̊֐Ŏ擾L[|CǵAĐnh̃[Nobt@𒼐ڎQƂĂ܂B
+ * Đ~Ԃł̎QƂ͉”\łA̍ĐJn͎QƂ֎~܂B
+ * ̃L[|Cgʂ̃ɃRs[ꍇ͕̏ς܂B + * + */ + CriMvCuePointInfo* GetCuePointInfo(CriError &err=CriMv::ErrorContainer); + + /*EN + * \ingroup MODULE_OPTION + * + * \brief Sets a function that will be called when a cue point is reached + * + * \param func Callback function + * \param usrobj Pointer to user-provided data + * \param err Optional error code + * + * Beginning with version 2.0, CRI Movie allows a movie to specify arbitrary actions to + * happen at various points on the timeline. These are referred to as \a cue \a points, or, + * more generally, as \a event \a points. If a cue point callback has been installed for the + * movie, it will be called whenever a cuepoint has been reached. + * + * The \a usrobj parameter specifies a pointer to arbitrary data, that will be passed as the + * third parameter to the callback. + * + * The prototype of the callback function is + * + * void callback(CriMvEasyPlayer *mveasy, CriMvEventPoint *eventinfo, void *usrobj) + * + * where + * + * mveasy is the EasyPlayer object
+ * eventinfo is the event info structure that was reached
+ * usrobj is the pointer to user data that was passed to SetFileRequestCallback().
+ * + * \remarks + * Do not call any movie playback functions (for example, CriMvEasyPlayer::Stop()) from the callback + * function. If you need to do this, set a flag from the callback and refer to it in your main loop. + * + * \sa CriMvEventPoint + */ + /*JP + * \ingroup MODULE_OPTION + * \brief L[|CgR[obN֐̓o^ + * \param func L[|CgR[obN֐ + * \param usrobj [UIuWFNg + * \param err G[iȗj + * + * L[|Cg̃R[obN֐o^܂B + * ̃R[obN֐́A[r̍ĐeCxg|CgŎw肳ꂽo߂ɔ܂B + * R[obN֐̌Ăяo CriMvEasyPlayer::Update() s܂B + * + * L[|CgR[obNAR[obN֐̑Q eventinfo ɂ̓Gxg|Cg񂪁A + * Rusrobjɂ́Ao^Ɏw肵[UIuWFNgn܂B + * + * L[|CgR[obN֐ł́A[rĐRg[֐iႦ CriMvEasyPlayer::Stop()j + * ĂяoĂ͂܂B + * + * \sa CriMvEventPoint + */ + void SetCuePointCallback(void (*func)(CriMvEasyPlayer *mveasy, CriMvEventPoint *eventinfo, void *usrobj), + void *usrobj, CriError &err=CriMv::ErrorContainer); + + + /*EN + * \ingroup MODULE_OPTION + * + * \brief Resets movie handle parameters to their default values + * + * \param err Optional error code + * + * This function will reset most parameters back to their default values. Call this when you are + * reusing an EasyPlayer handle and need to quickly undo changes to a number of parameters. + * + * Note that this will not remove a subaudio interface (set by CriMvEasyPlayer::AttachSubAudioInterface()). + * CriMvEasyPlayer::DetachSubAudioInterface() must be called instead. + * + * \remarks + * This function can be called once the EasyPlayer handle status is either MVEASY_STATUS_STOP or + * MVEASY_STATUS_PLAYEND. + * + * + *
Setting API Reset by ResetAllParameters() Reset by Stop() + *
SetFile YES (*1) + *
SetData YES (*1) + *
Pause YES YES + *
SetMasterTimer YES NO + *
SetNumberOfFramePools YES NO + *
SetBufferingTime YES NO + *
SetReloadThresholdTime YES NO + *
SetMaxBitrate YES NO + *
SetAudioTrack YES NO + *
SetLoopFlag YES NO + *
SetStreamingParameters YES NO + *
AttachSubAudioInterface NO NO + *
SetSubAudioTrack YES NO + *
ReplaceCenterVoice YES NO + *
SetFileRequestCallback YES NO + *
SetSeekPosition YES NO + *
SetCuePointCallback YES NO + *
+ * + * (*1) Normally, values set by SetFile() or SetData() are not reset by a call to Stop(). However, + * if a file request callback has been set (via CriMvEasyPlayer::SetFileRequestCallback()), this + * setting will be reset. + * + * \sa CriMvEasyPlayer::Stop(), CriMvEasyPlayer::SetFileRequestCallback() + */ + /*JP + * \ingroup MODULE_OPTION + * \brief p[^̃Zbg + * \param err G[iȗj + * + * Đnhɐݒ肳ꂽp[^ނZbg܂B
+ * TuI[fBIpC^tF[X̓Zbg܂̂ŁAAvP[VŖI + * CriMvEasyPlayer::DetachSubAudioInterface() ĂяoĂB + * + * {֐̓nhԂ MVEASY_STATUS_STOP ܂ MVEASY_STATUS_PLAYEND ̎ɌĂяoĂB + * + * + *
ݒ֐ ResetAllParametersɂ
Zbg
Stopɂ
Zbg + *
SetFile o (*1) + *
SetData o (*1) + *
Pause o o + *
SetMasterTimer o x + *
SetNumberOfFramePools o x + *
SetBufferingTime o x + *
SetReloadThresholdTime o x + *
SetMaxBitrate o x + *
SetAudioTrack o x + *
SetLoopFlag o x + *
SetStreamingParameters o x + *
AttachSubAudioInterface x x + *
SetSubAudioTrack o x + *
ReplaceCenterVoice o x + *
SetFileRequestCallback o x + *
SetSeekPosition o x + *
SetCuePointCallback o x + *
+ * (*1) ʏ̓Zbg܂Bt@CvR[obNo^Ăꍇ̓Zbg܂B + * + * \sa CriMvEasyPlayer::Stop() + */ + void ResetAllParameters(CriError &err=CriMv::ErrorContainer); + + /* Đp[Nobt@щʃW[̉iIȌĂяopj */ + void ReleasePlaybackWork(CriError &err=CriMv::ErrorContainer); + +public: /* for DEBUG */ + /*//EN + * \ingroup MODULE_OPTION + * + * \brief Sets the maximum movie data read size + * + * \param max_chunk_size The maximum read size, in bytes + * \param err Optional error code + * + * This is a DEBUG function and should not normally need to be used by applications. + * + * Sets the maximum read size. CRI Movie will attempt to read this many bytes each time it + * needs to load more movie data from disk. + * + * If this function is called, it must be called before calling any of the playback functions + * (CriMvEasyPlayer::Start(), CriMvEasyPlayer::Prepare(), or CriMvEasyPlayer::DecodeHeader()). + * + * To revert to the default behavior, pass 0 as \a max_chunk_size. + * + * \remarks + * If this function is called, the new value for \a max_chunk_size will not be reflected in the + * CriMvStreapingParameters structure. A call to CriMvEasyPlayer::GetMovieInfo() will return the + * original value that was set in the movie header. + * + * \remarks + * If you call CriMvEasyPlayer::SetStreamingParameters(), this function can not be used. + * + * \sa CriMvEasyPlayer::GetMovieInfo(), CriMvEasyPlayer::SetMinBufferSize() + */ + /*//JP + * \ingroup MODULE_OPTION + * \brief ő`NTCY̎w + * \param max_chunk_size ő`NTCY[byte] + * \param err G[iȗj + * + * [rf[^̍ő`NTCYw肵܂B
+ * ݂̃Cuł́A{֐̓AvP[VgpKv͂܂B
+ * + * {֐Őݒ肵ő`NTCÝACriMvEasyPlayer::GetMovieInfo ֐Ŏ擾郀[rɂ͔f܂B + * CriMvEasyPlayer::GetMovieInfo ֐Ŏ擾ł̂̓[rf[^̖{̏łB
+ * + * {֐̌ĂяóA CriMvEasyPlayer::Prepare ֐܂ CriMvEasyPlayer::Start ֐̑O܂łɎsĂB + * + * ő`NTCY 0w肵ꍇAő`NTCY̓[rf[^̎’lƂȂ܂B
+ * ܂AAvP[V CriMvEasyPlayer::SetStreamingParameters ֐Ăяoꍇ͖{֐ + * ݒ肵lA CriMvEasyPlayer::SetStreamingParameters ֐̎w肪D悳܂B + * + * \sa CriMvEasyPlayer::GetMovieInfo(), CriMvEasyPlayer::SetMinBufferSize() + */ + void SetMaxChunkSize(CriUint32 max_chunk_size, CriError &err=CriMv::ErrorContainer); + + /*//EN + * \ingroup MODULE_OPTION + * + * \brief Sets the minimum movie data buffer size + * + * \param min_buffer_size The minimum buffer size, in bytes + * \param err Optional error code + * + * This is a DEBUG function and should not normally need to be used by applications. + * + * Sets the minimum buffer size used for reading movie data from disk. + * + * If this function is called, it must be called before calling any of the playback functions + * (CriMvEasyPlayer::Start(), CriMvEasyPlayer::Prepare(), or CriMvEasyPlayer::DecodeHeader()). + * + * To revert to the default behavior, pass 0 as \a max_chunk_size. + * + * \remarks + * If this function is called, the new value for \a min_buffer_size will not be reflected in the + * CriMvStreapingParameters structure. A call to CriMvEasyPlayer::GetMovieInfo() will return the + * original value that was set in the movie header. + * + * \remarks + * If you call CriMvEasyPlayer::SetStreamingParameters(), this function can not be used. + * + * \sa CriMvEasyPlayer::GetMovieInfo(), CriMvEasyPlayer::SetMaxChunkSize() + */ + /*//JP + * \ingroup MODULE_OPTION + * \brief ŏobt@TCY̎w + * \param min_buffer_size ŏobt@TCY[byte] + * \param err G[iȗj + * + * [rf[^̍ŏobt@TCYw肵܂B
+ * ݂̃Cuł́A{֐̓AvP[VgpKv͂܂B
+ * + * {֐Őݒ肵ŏobt@TCÝACriMvEasyPlayer::GetMovieInfo ֐Ŏ擾郀[rɂ͔f܂B + * CriMvEasyPlayer::GetMovieInfo ֐Ŏ擾ł̂̓[rf[^̖{̏łB
+ * + * {֐̌ĂяóA CriMvEasyPlayer::Prepare ֐܂ CriMvEasyPlayer::Start ֐̑O܂łɎsĂB + * + * ŏobt@TCY 0w肵ꍇAŏobt@TCY̓[rf[^̎’lƂȂ܂B
+ * ܂AAvP[V CriMvEasyPlayer::SetStreamingParameters ֐Ăяoꍇ͖{֐ + * ݒ肵lA CriMvEasyPlayer::SetStreamingParameters ֐̎w肪D悳܂B + * + * \sa CriMvEasyPlayer::GetMovieInfo(), CriMvEasyPlayer::SetMaxChunkSize() + */ + void SetMinBufferSize(CriUint32 min_buffer_size, CriError &err=CriMv::ErrorContainer); + + /*EN + * \ingroup MODULE_OPTION + * + * \brief Retrieves various movie playback statistics + * + * \param playinfo Playback statistics structure + * \param err Optional error code + * + * This is a DEBUG function and is not normally needed by applications. + * + * Retrieves a number of performance statistics dealing with movie playback, including how often + * a frame could not be retrieved and how close the plaback framerate is to the movie's expected + * playback. + * + * This information is updated on every call to CriMvEasyPlayer::IsNextFrameOnTime(). In order for + * the values to be accurate, an application should call IsNextFrameOnTime() once each time through + * its main loop. Calling IsNextFrameOnTime() too often or not often enough will result in + * misleading statistics. + * + * \sa CriMvEasyPlayer::IsNextFrameOnTime() + */ + /*JP + * \ingroup MODULE_OPTION + * \brief [rĐ̎擾 + * \param playinfo [riԂlj + * \param err G[iȗj + * + * {֐͒ʏAAvP[V͎gp܂BfobOp̊֐łB + * + * ݍĐĂ郀[r̍Đ CriMvPlaybackInfo \̂擾ł܂B
+ * ̏񂩂rfIt[̎擾ԊuArfIt[̃fR[hxȂǂm邱Ƃł܂B
+ * + * Đ̓AvĂяo CriMvEasyPlayer::IsNextFrameOnTime() ōXV܂B
+ * AvP[V CriMvEasyPlayer::IsNextFrameOnTime()ĂяoȂꍇAC[vŕ + * Ăяoꍇ͏񂪐XVȂ̂ŒӂĂB
+ * + * \sa CriMvEasyPlayer::IsNextFrameOnTime() + */ + void GetPlaybackInfo(CriMvPlaybackInfo & playinfo, CriError & err = CriMv::ErrorContainer); + + /*EN + * \ingroup MODULE_OPTION + * + * \brief Gets the result of the last attempt to retrieve a video frame + * + * \param err Optional error code + * + * \return The result of the last frame retrieval + * + * Returns one of the following values: + * + * + * + * + * + * + * + *
Value Meaning
CRIMV_LASTFRAME_OK The frame was successfully retrieved.
CRIMV_LASTFRAME_TIME_EARLY It is too soon to display this frame. The frame time + * is greater than the current playback time.
CRIMV_LASTFRAME_DECODE_DELAY The frame has not been decoded yet, or CRI Movie is not + * done decoding it.
CRIMV_LASTFRAME_DISCARDED The frame was discarded, by calling + * CriMvEasyPlayer::DiscardNextFrame()
+ * + * \remarks + * The result is determined by calling CriMvEasyPlayer::IsNextFrameOnTime(), not the GetFrameOnTimeXXX() + * functions. + * + * \sa CriMvEasyPlayer::IsNextFrameOnTime(), CriMvEasyPlayer::DiscardNextFrame() + */ + /*JP + * \ingroup MODULE_OPTION + * \brief ÕrfIt[擾̌ʂ擾 + * \param err G[iȗj + * \return t[擾ʂ̗񋓒l + * + * {֐͒ʏAAvP[V͎gp܂BfobOp̊֐łB + * + * ÕrfIt[擾̌ʂԂ܂B + * rfIt[̃fR[hԂɍĂ̂ǂ`FbN邱Ƃo܂B + * + * :
+ * rfIt[擾̌ʂƂ́A{IɃAvP[VĂяo CriMvEasyPlayer::IsNextFrameOnTime() ̌ʂ + * XV܂BGetFrameOnTime֐̌ʂł͂܂B + * + * \sa CriMvEasyPlayer::IsNextFrameOnTime() + */ + CriMvLastFrameResult GetLastFrameResult(CriError & err = CriMv::ErrorContainer); + + /* [Unofficial] */ + /* Set the number of decoded frames to keep internally during the MVEASY_STATUS_PREP status. */ + /* Adjust the number if you need to reduce latesy for the first frame */ + void SetNumberOfFramesForPrep(CriUint32 num_frames, CriError & err = CriMv::ErrorContainer); + + /* [Unofficial] + * \ingroup MODULE_OPTION + * \brief ĐI/~ʒmR[obN֐̓o^ + * \param func ĐI/~ʒmR[obN֐ + * \param usrobj [UIuWFNg + * \param err G[iȗj + * + * ĐIэĐ~ʒmR[obN֐o^܂B + * ̃R[obN֐́Awb_/Đ/ĐԂĐ~/ĐIԂ + * JڂɈxĂяo܂B + * R[obN֐̌Ăяo CriMvEasyPlayer::Update() s܂B + * + * o^R[obN֐ł́A[rĐRg[֐iႦ CriMvEasyPlayer::Stop()j + * ĂяoĂ͂܂B + * + * : MVEASY_STATUS_PLAYENDԂMVEASY_STATUS_STOPԂւ̑Jڎɂ̓R[obN֐͌Ăяo܂B + */ + void SetStopCompleteCallback(void (*func)(CriMvEasyPlayer *mveasy, void *usrobj), + void *usrobj, CriError &err=CriMv::ErrorContainer); + + /* For FAST_LATENCY */ + /*************************************************************************************/ + /* RtBOw̃nh쐬֐ */ + static CriMvEasyPlayer* CRIAPI Create(CriHeap heap, + CriMvHandleConfig *config, + CriMvFileReaderInterface *freader, + CriMvSystemTimerInterface *stimer, + CriMvSoundInterface *sound, + CriError &err=CriMv::ErrorContainer); + + /* For Sofdec2 */ + /*************************************************************************************/ + enum MetaFlag { + MVEASY_META_FLAG_CUE = 0x0001, + MVEASY_META_FLAG_SEEK = 0x0002, + MVEASY_META_FLAG_ALL = MVEASY_META_FLAG_CUE + MVEASY_META_FLAG_SEEK, + + /* Keep enum 4bytes */ + MVEASY_META_FLAG_MAKE_ENUM_SINT32 = 0x7FFFFFFF + }; + + enum ReferFrameResult { + MVEASY_REFER_FRAME_RESULT_OK = (1), + MVEASY_REFER_FRAME_RESULT_SHORT_INPUT = (2), + MVEASY_REFER_FRAME_RESULT_SHORT_CPUTIME = (3), + MVEASY_REFER_FRAME_RESULT_DEMUX_STUCK = (4), + + /* Keep enum 4bytes */ + MVEASY_REFER_FRAME_RESULT_MAKE_ENUM_SINT32 = 0x7FFFFFFF + }; + + /* [Ũ[N̈nŁAnh쐬֐ */ + static CriMvEasyPlayer* CRIAPI Create(void *work, CriSint32 work_size, + CriMvHandleConfig *config, + CriMvFileReaderInterface *freader, + CriMvSystemTimerInterface *stimer, + CriMvSoundInterface *sound, + CriError &err=CriMv::ErrorContainer); + + /* Đp[N̈TCY̌vZ */ + CriSint32 CalcPlaybackWorkSize(const CriMvStreamingParameters *stmprm, CriError & err = CriMv::ErrorContainer); + + /* Đp[N̈̐ݒ֐ */ + void SetPlaybackWork(void *work, Sint32 work_size, CriError & err = CriMv::ErrorContainer); + + /* ^f[^[NpR[obN֐ */ + void SetMetaDataWorkAllocator(CriMvMetaDataWorkMallocFunc allocfunc, CriMvMetaDataWorkFreeFunc freefunc,void *usrobj, CriMvMetaFlag meta_flag); + + /* Ŏw肵t[̕\ */ + CriBool IsFrameOnTime(const CriMvFrameInfo *frameinfo, CriError &err=CriMv::ErrorContainer); + + /* t[̎QƁ@*/ + ReferFrameResult ReferFrame(CriMvFrameInfo &frameinfo, CriError &err=CriMv::ErrorContainer); + + /* YUV•ʃobt@tH[}bgł̃obt@擾 */ + CriBool LockFrameYUVBuffersWithAlpha(CriMvYuvBuffers &yuvbuffers, CriMvFrameInfo &frameinfo, CriMvAlphaFrameInfo &alpha_frameinfo, CriError &err=CriMv::ErrorContainer); + + /* LockFrameYUVBuffersWithAlphaŃbNt[̉ */ + CriBool UnlockFrameBufferWithAlpha(CriMvFrameInfo *frameinfo, CriMvAlphaFrameInfo *alpha_frameinfo, CriError &err=CriMv::ErrorContainer); + + /* 32bitARGBobt@tH[}bgւ̃Rs[֐ */ + CriBool CopyFrameToBufferARGB32(CriUint8 *dstbuf, CriUint32 dst_pitch, CriUint32 dst_bufsize, + const CriMvYuvBuffers *srcbufs, const CriMvFrameInfo *src_vinf, const CriMvAlphaFrameInfo *src_ainf, CriError &err=CriMv::ErrorContainer); + + /* 32bitARGBobt@tH[}bgփ݂̂̃Rs[֐ */ + CriBool CopyAlphaToBufferARGB32( + const CriMvFrameInfo *src_vinf, + CriUint8 *dst_buf, + CriUint32 dst_pitch, + CriUint32 dst_bufsize, + CriError &err=CriMv::ErrorContainer + ); + +#if defined(XPT_TGT_IPHONE) || defined(XPT_TGT_WINMO) || defined(XPT_TGT_ANDROID) || defined(XPT_TGT_CQSH2A) || defined(XPT_TGT_ACRODEA) || defined(XPT_TGT_NACL) || defined(XPT_TGT_SH7269) || defined(XPT_TGT_PC)|| defined(XPT_TGT_TRGP6K) + CriBool CopyFrameToBufferRGB565(CriUint8 *dstbuf, CriUint32 dst_pitch, CriUint32 dst_bufsize, + const CriMvYuvBuffers *srcbufs, const CriMvFrameInfo *src_vinf, const CriMvAlphaFrameInfo *src_ainf, CriError &err=CriMv::ErrorContainer); +#endif + + /* YUV•ʃobt@tH[}bg̃Rs[֐ */ + CriBool CopyFrameToBuffersYUV(CriMvYuvBuffers *dstbufs, + const CriMvFrameInfo *src_vinf, const CriMvAlphaFrameInfo *src_ainf, CriError &err=CriMv::ErrorContainer); + + /* [hobt@TCY̋w */ + void SetReadBufferSize(CriUint32 buffer_size, CriError &err=CriMv::ErrorContainer); + + CriUint32 GetMinBufferSize(CriError &err=CriMv::ErrorContainer); + /**************************************************************************************/ + void SetVideoFramerate(CriUint32 framerate_n, CriUint32 framerate_d); + + void SetCompareFrameTimeCallback( + CriBool (*func)(CriMvEasyPlayer *mveasy, CriMvFrameInfo *frameinfo, CriUint64 count, CriUint64 unit, void *usrobj), + void *usrobj, CriError &err=CriMv::ErrorContainer); + void SetSeekFrameAndOffset(CriSint32 seek_frame_id, CriUint64 seek_byte, CriError &err=CriMv::ErrorContainer); + + enum InputMode { + MVEASY_INPUT_UNDEFINED, + MVEASY_INPUT_STREAMING, /* Xg[~O */ + MVEASY_INPUT_MEMORY, /* ڎQƁijrij */ + + /* Keep enum 4bytes */ + MVEASY_INPUT_MAKE_ENUM_SINT32 = 0x7FFFFFFF + }; + /* : ̊֐̂߂ InputMode `bpublicֈړ */ + void SetMemoryPlaybackType(InputMode memplay_type, CriError &err=CriMv::ErrorContainer); + + /* fR[hXLbv̎s[h */ + //void SetAutoSkipDecode(CriBool sw, CriFloat32 margin_msec, CriError &err=CriMv::ErrorContainer) + + /* t@Cv̍ăR[obNv */ + void DeferFileRequest(CriError &err=CriMv::ErrorContainer); + + /* for specific use */ + void SetHeaderAndBodyData(const CriUint64Adr header_ptr, CriSint64 header_size, + const CriUint64Adr body_ptr, CriSint64 body_size); + CriSint32 CalcFramepoolWorkSize(const CriMvStreamingParameters *stmprm, CriError & err = CriMv::ErrorContainer); + void SetFramepoolWork(void *work, CriSint32 work_size, CriError & err = CriMv::ErrorContainer); + void SetFramepoolWorkAllocator(CriMvFramepoolWorkMallocFunc allocfunc, CriMvFramepoolWorkFreeFunc freefunc, void *usrobj); + void SetCapacityOfPictureSize(CriSint32 video_picsize, CriSint32 alpha_picsize, CriError &err); + void GetUsrCapacityOfPictureSize(CriSint32 *video_picsize, CriSint32 *alpha_picsize); + void SetMaxMovieSize(CriUint32 max_width, CriUint32 max_height, CriError &err); + void GetMaxMovieSize(CriUint32 *max_width, CriUint32 *max_height); + CriBool PlaybackResourceAllocated() const; + CriBool CanReusePlaybackResource(const CriMvStreamingParameters *stmprm) const; + CriBool GetReusePlaybackResourceFlag() const; + +private: + /* CRI internal use only */ + + void initializeHandleParameters(void); + void initializeCompareFrameParameters(void); + void resetHandleParameters(void); + CriBool startInputAndDecoding(void); + CriBool isEndReadFile(void); + void reinputDataForLooping(void); + void executeFileCloseServer(void); + void supplyDataFromStreamer(void); + void executeFileReadServer(void); + void executeFileOpenServer(void); + void executeCuePointServer(void); + //void executeAutoSkipDecode(void); + void executeWaitStatusServer(CriError &err = CriMv::ErrorContainer); + void surveilTerminationInput(void); + CriBool isAvailableCenterVoice(const CriMvStreamingParameters *stmprm); + CriBool isAvailableSubAudio(const CriMvStreamingParameters *stmprm); + CriBool attachCenterVoice(void); + void detachCenterVoice(void); + + CriBool attachSubAudioHandle(CriHeap heap); + void detachSubAudioHandle(void); + + void getAudioTime(CriUint64 &out_count, CriUint64 &out_unit, CriUint64 s_count, CriUint64 s_unit); + + CriBool allocAndCreateModules(void); + void startModules(void); + void requestStopModules(void); + CriBool closeFileIfOpening(void); + CriBool isCompleteStopModules(void); + void tryCleanupModules(CriMvPlyStatus mvstat); + CriBool tryFreeAndDestroySubmodules(void); + void freeAndDestroyModules(void); + + CriUint32 adjustNumTrackAudioOut(void); + + /* Xg[~Op̃p[^擾 */ + /* GetMovieInfo()Ƃ̈Ⴂ̓[Uwlǂ܂Ŕf邩B + * Ⴆ΁Aő`NTCY͂̊֐ł̓[UwlƂ邪AGetMovieInfoƃt@C̒lB + * ̊֐́AʼnʃW[쐬уmۂ鎞ɎgB */ + CriBool GetStreamingParameters(CriMvStreamingParameters &stmprm, CriError &err=CriMv::ErrorContainer); + + void setNormalErrorStatus(const CriChar8 *errmsg); + + CriBool compareFrameTimeSimple(CriMvEasyPlayer *mveasy, CriMvFrameInfo *frameinfo, CriUint64 count, CriUint64 unit, void *usrobj); + static CriBool compareFrameTimeFluctuation(CriMvEasyPlayer *mveasy, CriMvFrameInfo *frameinfo, CriUint64 count, CriUint64 unit, void *usrobj); + + Bool isNextFrameOnTime(CriBool update_stats, CriError &err); + Bool checkFrameTime(CriMvFrameInfo *frameinfo); + void updateGetFrameInfo(CriBool time_ready, CriBool acquired_frame, CriBool discard_frame, CriUint64 frame_count, CriUint64 frame_unit); + + /* for DEBUG */ + void crimveasy_SetSeekInfo(void); + + void executeUpdate(CriError &err); + +private: + static CriUint32 crimveasy_SupplyPcmDataByFloat32(void *obj, CriUint32 nch, CriFloat32 *pcmbuf[], CriUint32 req_nsmpl); + static CriUint32 crimveasy_SupplyPcmDataBySint16(void *obj, CriUint32 nch, CriSint16 *pcmbuf[], CriUint32 req_nsmpl); + static CriUint32 crimveasy_CalcAvailableNumSmpls(CriMvEasyPlayer *mveasy); + static CriUint32 crimveasy_GetWave16(CriMvEasyPlayer *mveasy, CriUint32 nch, CriSint16 *pcmbuf[], CriUint32 req_nsmpl); + static CriUint32 crimveasy_GetWave32(CriMvEasyPlayer *mveasy, CriUint32 nch, CriFloat32 *pcmbuf[], CriUint32 req_nsmpl); + + static CriUint32 crimveasy_SupplySubAudioDataByFloat32(void *obj, CriUint32 nch, CriFloat32 *pcmbuf[], CriUint32 req_nsmpl); + static CriUint32 crimveasy_GetSubAudioWave32(CriMvEasyPlayer *mveasy, CriUint32 nch, CriFloat32 *pcmbuf[], CriUint32 req_nsmpl); + static CriUint32 crimveasy_SupplySubAudioDataBySint16(void *obj, CriUint32 nch, CriSint16 *pcmbuf[], CriUint32 req_nsmpl); + static CriUint32 crimveasy_GetSubAudioWave16(CriMvEasyPlayer *mveasy, CriUint32 nch, CriSint16 *pcmbuf[], CriUint32 req_nsmpl); + +public: + CriMvPly mvply; /* Temporally allowed to access for debug */ + +private: + CriHeap heap; + CriBool user_stmprm_flag; + CriMvStreamingParameters stmprm; + CriBool alloced_submodules_flag; + CriMvFrameInfo frameinfo; + CriMvAlphaFrameInfo alpha_frame; + CriMvFileReaderInterface *freader; + CriMvSoundInterface *sndout; + CriMvSystemTimerInterface *stimer; + TimerType timertype; + Status pre_ezstat; + CriBool req_decode_header_flag; + CriBool req_prepare_flag; + CriBool pause_flag; + CriUint32 npools; + CriSint32 track_play_audio; + CriUint32 num_track_audio_data; + CriUint32 num_track_audio_out; + CriBool loop_flag; + CriUint64 time_count; + CriUint64 time_unit; + CriSint64 total_read; + CriSint64 fsize_byte; + CriChunk read_crick; + CriBool exe_open; + CriBool exe_close; + CriBool exe_read; + + CriUint64 time_syslog_count; /* VXe^C}̋L^ */ + CriUint64 time_syslog_unit; + CriUint64 time_ofs_count; /* I[fBIĨVXe^C} */ + CriUint64 time_ofs_unit; + CriUint64 time_prev_audio_count; /* I[fBIω`FbNp */ + CriUint64 time_prev_audio_unit; + + CriFloat32 user_buffering_sec; /* 0.0f means AUTO */ + CriUint32 user_max_bitrate; /* 0 means AUTO */ + CriUint32 user_max_chunk_size; /* 0 means AUTO */ + CriUint32 user_min_buffer_size; /* 0 means AUTO */ + CriSint32 user_read_buffer_size; /* CRIMV_READ_BUFFER_SIZE_AUTO means AUTO */ + CriSint32 user_video_capacity_of_picsize; /* 0 means AUTO */ + CriSint32 user_alpha_capacity_of_picsize; /* 0 means AUTO */ + CriUint32 user_max_width; + CriUint32 user_max_height; + + CriSint32 usr_subtitle_channel; + CriMvSubtitleInfo sbtinfo; + CriFloat32 sbt_start_msec; + CriFloat32 sbt_end_msec; + CriUint8 *sbtbuf; + + enum InputSrc { + MVEASY_INPUT_SRC_UNDEFINED, + MVEASY_INPUT_SRC_FILE, + MVEASY_INPUT_SRC_MEMORY, + /* Keep enum 4bytes */ + MVEASY_INPUT_SRC_MAKE_ENUM_SINT32 = 0x7FFFFFFF + }; + InputSrc input_src; + CriMvFileReaderInterface *ext_reader; + CriMvFileReaderInterface *mem_reader; + + enum InputSupplyStatus { + MVEASY_SUPPLY_STOP, + MVEASY_SUPPLY_REQ_OPEN, + MVEASY_SUPPLY_OPENING, + MVEASY_SUPPLY_READING, + MVEASY_SUPPLY_REQ_CLOSE, + MVEASY_SUPPLY_CLOSING, + + /* Keep enum 4bytes */ + MVEASY_SUPPLY_MAKE_ENUM_SINT32 = 0x7FFFFFFF + }; + + InputMode memplay_type; /* ĐXg[邩jri邩 */ + InputMode input_mode; + InputSupplyStatus supply_stat; + CriBool change_file_mode; + CriChar8 file_name[CRIMV_MAX_FILE_NAME]; + CriUint64 file_offset; + CriSint64 file_range; + CriUint8 *dataptr; + CriUint32 datasize; + CriBool terminate_flag; + CriSint32 reinput_cnt; + + enum NextEntryState { + MVEASY_NEXT_ENTRY_NONE, + MVEASY_NEXT_ENTRY_READY, + MVEASY_NEXT_ENTRY_DEFER, + /* Keep enum 4bytes */ + MVEASY_NEXT_ENTRY_MAKE_ENUM_SINT32 = 0x7FFFFFFF + }; + NextEntryState next_entry_state; + + CriUint32 center_ch; + CriSint32 usr_voice_track; // by SetCenterVoice() + CriSint32 voice_attached_track; + + // Sub Audio + CriMvSoundInterface *if_subaudio; + CriSint32 usr_subaudio_track; + CriSint32 attached_subaudio_track; + + void (*cbfunc_file_request)(CriMvEasyPlayer *mveasy, void *usrobj); + void *usrobj_file_request; + + CriBool (*cbfunc_compare_ftime)(CriMvEasyPlayer *mveasy, CriMvFrameInfo *frameinfo, CriUint64 count, CriUint64 unit, void *usrobj); + void *usrobj_compare_ftime; + + /* Seek Playback */ + CriSint32 seek_frame_id; + CriUint64 seek_byte; + + /* CuePoint */ + void (*cbfunc_cuepoint)(CriMvEasyPlayer *mveasy, CriMvEventPoint *eventinfo, void *usrobj); + void *usrobj_cuepoint; + + /* Playback Statistics */ + CriBool start_getfrm; + CriUint64 last_getfrm_count; + CriFloat32 sum_diff_time; + CriMvPlaybackInfo playinfo; + CriMvLastFrameResult last_frm_result; + + /* Block flag for simultanious calls on multi-threads */ + CriSint32 execute_decode_block_flag; + CriSint32 update_block_flag; + + /* Stop Completion Notification */ + void (*cbfunc_stopcomplete)(CriMvEasyPlayer *mveasy, void *usrobj); + void *usrobj_stopcomplete; + + /* For Sofdec2 */ + void *playback_work; + CriSint32 playback_work_size; + void *mvply_work; + CriHeap heap_mveasy; + CriHeap heap_extra_sound; + CriBool reuse_modules_flag; + + /* For Debug */ + volatile CriUint8 end_sequence_info; + + /* Handle Protection */ + void *cshn; + void *cs_work; + + /* Skip Decoding */ + //CriBool skip_auto_flag; + //CriFloat32 margin_msec; + +public: + enum FrameCompareMode { + MVEASY_COMPARE_MODE_JUST, /* mɎr */ + MVEASY_COMPARE_MODE_DELAY_GET, /* ^C}O|t[͂ȂׂnȂ */ + MVEASY_COMPARE_MODE_FAST_GET, /* ^C}𐅑t[͂Ȃׂn */ + + /* Keep enum 4bytes */ + MVEASY_COMPARE_MODE_MAKE_ENUM_SINT32 = 0x7FFFFFFF + }; + FrameCompareMode compare_mode; + CriFloat32 accuracy_system_tmr_msec; /* VXex milli sec */ + CriFloat32 accuracy_audio_tmr_msec; /* I[fBIx milli sec */ + CriFloat32 fluctuation_system; /* VXeiSyncFrame)̗h炬 milli sec */ + CriFloat32 fluctuation_adjust; /* h炬␳ */ +// CriFloat32 fluctuation_system_msec; /* VXe炬 milli sec */ +// CriFloat32 fluctuation_audio_msec; /* I[fBI炬 milli sec */ +// CriFloat32 fluctuation_adjust; /* 炬␳{ */ +// CriSint32 fluctuation_system_usec; /* VXe炬 micro sec */ +// CriSint32 fluctuation_audio_usec; /* I[fBI炬 micro sec */ +// CriFloat32 fluctuation_adjust_multi; /* 炬␳{ */ +// CriSint32 fluctuation_adjust_add; /* 炬␳ItZbg */ + +private: + CriBool req_stop_modules; + CriBool error_flag; + CriBool req_start_modules; + +protected: + CriMvEasyPlayer(CriHeap heap, + CriMvFileReaderInterface *freader, + CriMvSystemTimerInterface *stimer, + CriMvSoundInterface *sound, + CriError &err=CriMv::ErrorContainer); + virtual ~CriMvEasyPlayer(); + +private: + CriMvEasyPlayer(void); //disabled +}; + + + + +#endif /* CRI_MOVIE_H_INCLUDED */ diff --git a/3rdParty/cri/XboxOne/include/cri_movie_core.h b/3rdParty/cri/XboxOne/include/cri_movie_core.h new file mode 100644 index 00000000..705bbbf6 --- /dev/null +++ b/3rdParty/cri/XboxOne/include/cri_movie_core.h @@ -0,0 +1,2554 @@ +/**************************************************************************** + * + * CRI Middleware SDK + * + * Copyright (c) 2005-2013 CRI Middleware Co., Ltd. + * + * Library : CRI Movie + * Module : Library User's Header + * File : cri_movie_core.h + * Date : 2013-11-21 + * Version : (see CRIMVPLY_VER) + * + ****************************************************************************/ +/*! + * \file cri_movie_core.h + */ +#ifndef CRI_MOVIE_CORE_H_INCLUDED /* Re-definition prevention */ +#define CRI_MOVIE_CORE_H_INCLUDED + +/* Version No. */ +#define CRIMVPLY_VER "3.50" +#define CRIMVPLY_NAME "criMvPly" + +/*************************************************************************** + * Include file + ***************************************************************************/ +#include +#include +#include + +/*************************************************************************** + * MACRO CONSTANT + ***************************************************************************/ + +/*EN + * \brief Audio OFF setting of Audio Track + * \ingroup MDL_MV_OPTION + * \sa CriMvEasyPlayer::SetAudioTrack() + */ +/*JP + * \brief I[fBIĐOFF̎wl + * \ingroup MDL_MV_OPTION + * \sa CriMvEasyPlayer::SetAudioTrack() + */ +#define CRIMV_AUDIO_TRACK_OFF (-1) + +/*EN + * \brief Default setting of Audio Track + * \ingroup MDL_MV_OPTION + * \sa CriMvEasyPlayer::SetAudioTrack() + */ +/*JP + * \brief I[fBI`l̃ftHgl + * \ingroup MDL_MV_OPTION + * \sa CriMvEasyPlayer::SetAudioTrack() + */ +#define CRIMV_AUDIO_TRACK_AUTO (100) + +/*EN + * \brief Maximum number of PCM tracks in one audio stream + * \ingroup MDL_MV_OPTION + */ +/*JP + * \brief I[fBIf[^̍őPCMgbN + * \ingroup MDL_MV_OPTION + */ +#define CRIMV_PCM_BUFFER_MAX (8) + +/*EN + * \brief Subtitle OFF setting + * \ingroup MDL_MV_OPTION + * \sa CriMvEasyPlayer::SetSubtitleChannel() + */ +/*JP + * \brief ĐOFF̎wl + * \ingroup MDL_MV_OPTION + * \sa CriMvEasyPlayer::SetSubtitleChannel() + */ +#define CRIMV_SUBTITLE_CHANNEL_OFF (-1) + +/*EN + * \brief Maximum number of video tracks in a movie file + * \ingroup MDL_MV_OPTION + */ +/*JP + * \brief [rt@C̍őrfIXg[ + * \ingroup MDL_MV_OPTION + */ +#define CRIMV_MAX_VIDEO_NUM (1) + +/*EN + * \brief Maximum number of audio tracks in a movie file + * \ingroup MDL_MV_OPTION + */ +/*JP + * \brief [rt@C̍őI[fBIXg[ + * \ingroup MDL_MV_OPTION + */ +#define CRIMV_MAX_AUDIO_NUM (32) + +/*EN + * \brief Maximum number of alpha tracks in a movie file + * \ingroup MDL_MV_OPTION + */ +/*JP + * \brief [rt@C̍őAt@Xg[ + * \ingroup MDL_MV_OPTION + */ +#define CRIMV_MAX_ALPHA_NUM (1) + +#if defined(XPT_TGT_PC) +/*EN + * \brief Number of extra threads for multicore decoding + * \ingroup MDL_MV_OPTION + * The number of additional decoding threads that CRI Movie library internally creates. + * The threads are intended to run on multiple processors in parallel. + * \sa CriMvEasyPlayer::SetUsableProcessors_PC() + */ +/*JP + * \brief }`RAfR[hp̒lj̃fR[hXbh + * \ingroup MDL_MV_OPTION + * CRI MovieCuō쐬lj̃fR[h̐łB̃Xbh́A}`RAPC + * fR[h񕪎U邽߂ɍ܂B + * \sa CriMvEasyPlayer::SetUsableProcessors_PC() + */ +#define CRIMV_NUM_EXT_DECTHREAD_PC (3) + +/*EN + * \brief Default affnity mask of a thread + * \ingroup MDL_MV_OPTION + * \sa CriMvEasyPlayer::SetUsableProcessors_PC() + */ +/*JP + * \brief XbhAtBjeB}XÑftHgݒl + * \ingroup MDL_MV_OPTION + * \sa CriMvEasyPlayer::SetUsableProcessors_PC() + */ +#define CRIMV_DEFAULT_AFFNITY_MASK_PC (0xFFFFFFFF) + + +/*EN + * \brief Default priority of a thread + * \ingroup MDL_MV_OPTION + * \sa CriMvEasyPlayer::SetUsableProcessors_PC() + */ +/*JP + * \brief Xbh̃ftHgDx + * \ingroup MDL_MV_OPTION + * \sa CriMvEasyPlayer::SetUsableProcessors_PC() + */ +#define CRIMV_DEFAULT_THREAD_PRIORITY_PC (0x8000000) +#endif + +/*EN + * \brief Default value of the read buffer size + * \ingroup MDL_MV_OPTION + * \sa CriMvEasyPlayer::SetReadBufferSize() + */ +/*JP + * \brief [hobt@TCYftHgl + * \ingroup MDL_MV_OPTION + * \sa CriMvEasyPlayer::SetReadBufferSize() + */ +#define CRIMV_READ_BUFFER_SIZE_AUTO (-1) + + +/*************************************************************************** + * Library Spec Defenition + ***************************************************************************/ + +/* */ + +/* 2007-09-06:URUSHI I[fBĨTuW[ * + * MvPlỹI[fBICriMvPlyAmngƂVȃNXɐ؂oB* + * CriMvPlyAmng̓f}`vNTSgbNf[^󂯎āA * + * gbNƂɊUꂽAdecɏn܂B * + * ړI͈ȉ̓ * + * 1) I[fBIgbN̓Iؑ * + * 2) [vĐł̈قȂ`uڂ̓ */ + +#define NUM_MAX_ADEC (2) /* Adec̍ő吔 */ +/* ADEC̃CfbNX` */ +/* indexgCriMvPlyAmngAdecRg[ĂB */ +#define MAIN_ADEC_IDX (0) // CgbNp +#define SUB_ADEC_IDX (1) // {CXgbNp + +/* I[fBI̓Iؑ֋@\T|[g邩 */ +//#define ENABLE_DYNAMIC_AUDIO_SWITCH + +#if defined(ENABLE_DYNAMIC_AUDIO_SWITCH) + #define CRIMVPLYAMNG_TRACK_OFF (512) // ؂ւgbNԍ̃ftHgliؑւneej + + /* gbN̓Iؑւ̂߂̏Ԓ` */ + typedef enum _crimvplyamng_track_state { + CRIMVPLYAMNG_TRACK_STATE_FIXED = (1), // ftHg + CRIMVPLYAMNG_TRACK_STATE_PREP_SWITCHING, // [Uؑւ𖽗߂Aؑւ̏iKî߂̊ԂZbgj + CRIMVPLYAMNG_TRACK_STATE_SWITCHING // ؑ֌Ɛ̎sȂĐؑւsȂ + } CriMvPlyAmngTrackState; +#endif + +/* AĐA2–ڈȍ~̃wb_擾ł悤ɂ邽 */ +#define CRIMVPLY_HEAD_CONTAINER_NUM (2) + +/* ēǂݍ臒l̃ftHgl */ +#define CRIMV_DEFAULT_RELOAD_THRESHOLD (0.8f) // 0.8[sec] + +/* Đ̒t[ftHgl */ +#define CRIMV_DEFAULT_NUM_FRAMES_FOR_PREP (-1) /* ftHgFsgp (t[v[̗p) */ + +/* [N̈̊mۂCRI HeapgpȂ */ +#define CRIMV_REMOVE_CRIHEAP + +/* @ŗLt[ */ +#define CRIMV_FRAME_DETAILS_NUM (2) + +/* CriVavfios Ŏw肷Ot@C̃pX̏ */ +#if defined(XPT_TGT_IOS) + #define CRIMVPLY_VAVFIOS_MAX_FILEPATH (256) +#endif + +/*************************************************************************** + * Process MACRO + ***************************************************************************/ +#define criMv_SetDefaultHandleConfig(p_config) \ +{\ + (p_config)->readbuffer_size = 0;\ +} + +/*************************************************************************** + * Enum declaration + ***************************************************************************/ +/*EN + * \brief Speaker index of CRI Movie PCM output + * \ingroup MDL_MV_OPTION + */ +/*JP + * \brief CRI Movie PCMo͂̃Xs[J[zu + * \ingroup MDL_MV_OPTION + */ +typedef enum { + CRIMV_PCM_BUFFER_L = 0, /*EN< The LEFT channel of CRI Movie output */ + /*JP< CRI Movie I[fBIo͂ LEFT `l */ + CRIMV_PCM_BUFFER_R = 1, /*EN< The RIGHT channel of CRI Movie output */ + /*JP< CRI Movie I[fBIo͂ RIGHT `l */ + CRIMV_PCM_BUFFER_LS = 2, /*EN< The Surround LEFT channel of CRI Movie output */ + /*JP< CRI Movie I[fBIo͂ Surround LEFT `l */ + CRIMV_PCM_BUFFER_RS = 3, /*EN< The Surround RIGHT channel of CRI Movie output */ + /*JP< CRI Movie I[fBIo͂ Surround RIGHT `l */ + CRIMV_PCM_BUFFER_C = 4, /*EN< The CENTER channel of CRI Movie output */ + /*JP< CRI Movie I[fBIo͂ CENTER `l */ + CRIMV_PCM_BUFFER_LFE = 5, /*EN< The LFE channel of CRI Movie output */ + /*JP< CRI Movie I[fBIo͂ LFE `l */ + CRIMV_PCM_BUFFER_EXT1 = 6, /*EN< The EXT1(Rear Left) channel of CRI Movie output */ + /*JP< CRI Movie I[fBIo͂ EXT1(Rear Left) `l */ + CRIMV_PCM_BUFFER_EXT2 = 7, /*EN< The EXT2(Rear Right) channel of CRI Movie output */ + /*JP< CRI Movie I[fBIo͂ EXT2(Rear Right) `l */ + + /* Keep enum 4bytes */ + CRIMV_PCM_BUFFER_MAKE_ENUM_SINT32 = 0x7FFFFFFF +} CriMvPcmBufferIndex; + + +/*EN + * \brief Composite mode of alpha movie + * \ingroup MDL_MV_OPTION + */ +/*JP + * \brief At@[r̍[h + * \ingroup MDL_MV_OPTION + */ +typedef enum { + CRIMV_COMPO_OPAQ = 0, /*EN< Opacity, no alpha value */ + /*JP< sAAt@Ȃ */ + CRIMV_COMPO_ALPHFULL = 1, /*EN< Full alpha blending (8bits-alpha data) */ + /*JP< tAlphaiAt@pf[^8rbg) */ + CRIMV_COMPO_ALPH3STEP = 2, /*EN< 3 Step Alpha */ + /*JP< 3lAt@ */ + CRIMV_COMPO_ALPH32BIT = 3, /*EN< Full alpha blending (32bits color + alpha data) */ + /*JP< tAlphaAiJ[ƃAt@f[^32rbgj */ + CRIMV_COMPO_ALPH1BIT = 4, /*EN< Alpha blending (24bits color + 1->8bits alpha) */ + /*JP< tAlphaAiJ[ƃAt@f[^32bitAl2lj */ + CRIMV_COMPO_ALPH2BIT = 5, /*EN< Alpha blending (24bits color + 2->8bits alpha) */ + /*JP< tAlphaAiJ[ƃAt@f[^32bitAl4lj */ + CRIMV_COMPO_ALPH3BIT = 6, /*EN< Alpha blending (24bits color + 3->8bits alpha) */ + /*JP< tAlphaAiJ[ƃAt@f[^32bitAl8lj */ + CRIMV_COMPO_ALPH4BIT = 7, /*EN< Alpha blending (24bits color + 4->8bits alpha) */ + /*JP< tAlphaAiJ[ƃAt@f[^32bitAl16lj*/ + + /* Keep enum 4bytes */ + CRIMV_COMPO_MAKE_ENUM_SINT32 = 0x7FFFFFFF +} CriMvAlphaType; + + +/*EN + * \brief Result of the last video frame retrieval + * \ingroup MDL_MV_OPTION + */ +/*JP + * \brief ÕrfIt[擾̌ + * \ingroup MDL_MV_OPTION + */ +typedef enum { + CRIMV_LASTFRAME_OK = 0, /*EN< Succeeded */ + /*JP< 擾 */ + CRIMV_LASTFRAME_TIME_EARLY = 1, /*EN< Failed. The frame is not yet the time to draw */ + /*JP< 擾sBt[\ĐԂɒBĂȂ */ + CRIMV_LASTFRAME_DECODE_DELAY = 2, /*EN< Failed. The frame to draw is not decoded yet */ + /*JP< 擾sBrfIt[̃fR[hԂɍȂ */ + CRIMV_LASTFRAME_DISCARDED = 3, /*EN< Failed. The video frame is discarded by app */ + /*JP< 擾sBAvɂĔjꂽ */ + //CRIMV_LASTFRAME_NO_INPUT_DATA = 4, //Not supported yet + //CRIMV_LASTFRAME_SKIPPED = 5, //Not supported yet + //CRIMV_LASTFRAME_DEMUX_STUCKED = 6, //Not supported yet + + /* Keep enum 4bytes */ + CRIMV_LASTFRAME_MAKE_ENUM_SINT32 = 0x7FFFFFFF +} CriMvLastFrameResult; + +#if defined(XPT_TGT_PS3PPU) +/*EN + * \brief Graphic Environment type for PS3 + * \ingroup MDL_MV_OPTION + */ +/*JP + * \brief PS3̃OtBbN‹ + * \ingroup MDL_MV_OPTION + */ +typedef enum { + CRIMV_GRAPHIC_ENV_GCM = 0, /*EN< GCM. (or same ARGB 32bit texture format of GCM) */ + /*JP< GCM‹ (܂̓eNX`tH[}bgGCMƓ‹) */ + CRIMV_GRAPHIC_ENV_PSGL = 1, /*EN< PSGL. (or same ARGB 32bit texture format of PSGL) */ + /*JP< PSGL‹ (܂̓eNX`tH[}bgPSGLƓ‹) */ + + /* Keep enum 4bytes */ + CRIMV_GRAPHIC_ENV_MAKE_ENUM_SINT32 = 0x7FFFFFFF +} CriMvGraphicEnv; +#endif + + +/* CRI Movie Interanl handle status + * + * The possible legal states of a CriMvPly handle. Over the course of your application + * the CriMvPly handle will walk through the following states in roughly the following + * order. In states that are waiting states, you can request the + * CriMvPly handle to advance to the next state by calling the criMvPly_IncrementState() + * function. You can check the status of a valid CriMvPly handle at any time + * by calling criMvPly_GetStatus(). + * + * It is not possible to jump from a state to an arbitrary other state. Normal play + * proceeds from the CRIMVPLY_STATUS_STOP state through the CRIMV_PLY_STATUS_PLAYEND + * state in that order. Premature termination can be requested with the criMvPly_Stop() + * function. + * + * \sa criMvPly_IncrementState(), criMvPly_GetStatus(), criMvPly_Stop() + */ +typedef enum { + CRIMVPLY_STATUS_STOP = 0, /* Standstill. No processing is occurring. + * CriMvPly handles are created into this state. + */ + /* ~ */ + CRIMVPLY_STATUS_DECHDR = 1, /* The CriMvPly structure is now parsing the header + * of the file, including information on height and width + * of the video stream. + */ + /* wb_͒ */ + CRIMVPLY_STATUS_WAIT_PREP = 2, /* The header has been decoded and criMvPly_GetStreamingParameters() + * will now provide valid values. Typically you will call + * criMvPly_AllocateWorkBuffer() with this information at this point. + */ + /* PREPԂւIncrementState҂
+ AllocateWorkBufferĂ玟ւ */ + CRIMVPLY_STATUS_PREP = 3, /* Transition to this state to acknowledge to the + * CriMvPly handle that you have allocated your work buffers. */ + /* Đ */ + CRIMVPLY_STATUS_WAIT_PLAYING = 4, /* The audio and video decoders are now ready to begin playback.*/ + /* PLAYINGԂւIncrementState҂
+ ̏ԂŊɃrfIƃI[fBĨfR[hʂ͎擾łB*/ + CRIMVPLY_STATUS_PLAYING = 5, /* The decoders are currently decoding and playing output. */ + /* Đ */ + CRIMVPLY_STATUS_WAIT_PLAYEND = 6, /* The library is waiting for you to acknowledge the end of the movie. You + * have informed the CriMvPly structure that an end-of-file condition exists, + * but final frames of video and audio may still be pending in your application. */ + /* PLAYENDԂւIncrementState҂ */ + CRIMVPLY_STATUS_PLAYEND = 7, /* You have acknowledged the end of the movie. Teardown can occur at this point. */ + /* ĐI */ + CRIMVPLY_STATUS_STOP_PROCESSING = 8, /* A request to stop has been received by the CriMvPly structure, + * that is, you have called criMvPly_Stop(), and a stop is now pending. */ + /* ~ */ + CRIMVPLY_STATUS_WAIT_STOP = 9, /* The CriMvPly handle has acknowledged the stop request and + * you may now call criMvPly_IncrementState() to transition to + * the CRIMVPLY_STATUS_STOP state. */ + /* STOPԂւIncrementState҂ */ + CRIMVPLY_STATUS_ERROR = 10, /* An error has occurred. */ + /* G[ */ + + /* Keep enum 4bytes */ + CRIMVPLY_STATUS_MAKE_ENUM_SINT32 = 0x7FFFFFFF +} CriMvPlyStatus; + + +/* Sofdec2 */ +typedef enum { + CRIMVPLY_META_FLAG_OFF = 0x0000, + CRIMVPLY_META_FLAG_CUE = 0x0001, + CRIMVPLY_META_FLAG_SEEK = 0x0002, + CRIMVPLY_META_FLAG_ALL = CRIMVPLY_META_FLAG_CUE + CRIMVPLY_META_FLAG_SEEK, + + /* Keep enum 4bytes */ + CRIMVPLY_META_FLAG_MAKE_ENUM_SINT32 = 0x7FFFFFFF +} CriMvMetaFlag; + +/* Color Conversion*/ +typedef enum{ + CRIMV_COLORSPACE_CONVERSION_TYPE_ITU_R_BT601_LIMITED = 0, + CRIMV_COLORSPACE_CONVERSION_TYPE_ITU_R_BT601_FULLRANGE = 1, + + /* Keep enum 4bytes */ + CRIMV_COLORSPACE_CONVERSION_TYPE_ENUM_SINT32 = 0x7FFFFFFF +}CriMvColorSpaceConversionType; + +typedef void *(*CriMvMetaDataWorkMallocFunc)(void *obj, CriUint32 size); +typedef void (*CriMvMetaDataWorkFreeFunc)(void *obj, void *mem); + +/* OUTER_FRAMEPOOL_WORK */ +#define CriMvFramepoolWorkMallocFunc CriMvMetaDataWorkMallocFunc +#define CriMvFramepoolWorkFreeFunc CriMvMetaDataWorkFreeFunc + +/*************************************************************************** + * Data type declaration + ***************************************************************************/ + +/*EN + * \brief Audio parameters + * \ingroup MDL_MV_INFO + * + * \sa CriMvStreamingParameters, CriMvWaveInfo + */ +/*JP + * \brief I[fBIp[^ + * \ingroup MDL_MV_INFO + * + * I[fBIXg[̃p[^ + * \sa CriMvStreamingParameters, CriMvWaveInfo + */ +typedef struct { + CriUint32 sampling_rate; /*EN< Sampling rate */ + /*JP< TvOg */ + CriUint32 num_channel; /*EN< Number of channels. Monaural = 1, Stereo = 2 */ + /*JP< I[fBI`l */ + CriUint32 total_samples; /*EN< Total number of samples */ + /*JP< Tv */ + CriUint32 output_buffer_samples; /*EN< Output wave buffer size */ + /*JP< TEho̓obt@̃Tv */ + CriUint32 codec_type; /*EN< Codec type */ + /*JP< R[fbN */ + +} CriMvAudioParameters; + +/*EN + * \brief Video Parameters + * \ingroup MDL_MV_INFO + * \sa CriMvStreamingParameters + */ +/*JP + * \brief rfIp[^ + * \ingroup MDL_MV_INFO + * rfIXg[̃p[^ + * \sa CriMvStreamingParameters + */ +typedef struct { + CriUint32 max_width; /*EN< Maximum video width for stream. (multiple of 8) */ + /*JP< [rő啝iW̔{j */ + CriUint32 max_height; /*EN< Maximum video height for stream. (multiple of 8)*/ + /*JP< [rő卂iW̔{j */ + CriUint32 disp_width; /*EN< Width of the image to draw. */ + /*JP< \f̉sNZi[j */ + CriUint32 disp_height; /*EN< Height of the image to draw. */ + /*JP< \f̏csNZi[j */ + CriUint32 num_frame_pool; /*EN< Number of frame pools required for stream */ + /*JP< t[v[ */ + CriUint32 framerate; /*EN< Frame rate per second [x1000]. */ + /*JP< t[[g[x1000] */ + CriUint32 framerate_n; /*EN< Frame rate (in rational as numerator). framerate_n/framerate_d = framerate */ /* UTODO: ϐ */ + /*JP< t[[g̕q(L`)Bframerate_n/framerate_d = framerate */ + CriUint32 framerate_d; /*EN< Frame rate (in rational as denominator). */ + /*JP< t[[g̕(L`)B */ + CriUint32 total_frames; /*EN< Total number of video frames */ + /*JP< t[ */ + + CriUint32 material_width; /*EN< Width of the video source resolustion before encoding. */ + /*JP< GR[hÕrfIfނ̉sNZ */ + CriUint32 material_height; /*EN< Height of the video source resolustion before encoding. */ + /*JP< GR[hÕrfIfނ̏csNZ */ + CriUint32 screen_width; /*EN< Screen width set by encoding and cropping. + * This parameter is only available when you encoded the movie with "Widescreen TV Support" option. + * Normally this value is 0. */ + /*JP< GR[hɎw肵XN[B + * ̒l̓GR[hɁuCherx@\vgpꍇ̂ݗLɂȂ܂B + * ʏ͂OłB */ + + CriUint32 codec_type; /*EN< Video Codec Type. If you encoded the movie for PS2, this value is 2. + * Normally this value is 1 or 0(no info). + * If the codec_type is 1, the CRI Movie for ONLY PS2 can play the movie file. */ + /*JP< rfIR[fbNʁBPS2pɃGR[hꍇ 2ɂȂ܂B + * ʏ 1܂ 0(񖳂)łB + * R[fbNʂQ̃[ŕAPS2ŃCuŁû݁vД\łB */ + CriUint32 codec_dc_option; /*EN< Video Codec DC Option. If you encoded the movie for PS2, this value is 10. + * Normally this value is 11 or 0(no info). + * If the codec_type is 11, the CRI Movie for PS2 can NOT play the movie file. */ + /*JP< rfIR[fbNDCIvVʁBPS2pɃGR[hꍇ10ɂȂ܂B + * ʏ11܂ 0(񖳂)łB + * R[fbNDCIvV11̃[ŕAPS2ŃCuuł́vĐł܂B */ + CriUint32 color_conversion_type; /*EN< Color space converion type. Fullrange or Limited.*/ + /*JP< Fϊ^CvB */ + CriSint32 capacity_of_picsize; /*EN< Capacity size of video pictures. */ + /*JP< sN`TCYl */ + CriUint32 average_bitrate; /*EN< Average bitrate. */ + /*JP< σrbg[g */ +} CriMvVideoParameters; + +/*EN + * \brief Alpha Parameters + * \ingroup MDL_MV_INFO + * \sa CriMvStreamingParameters + */ +/*JP + * \brief At@p[^ + * \ingroup MDL_MV_INFO + * At@Xg[̃p[^ + * \sa CriMvStreamingParameters + */ +typedef struct { + CriUint32 max_width; /*EN< Maximum alpha width for stream */ + /*JP< At@t[̍ő啝 */ + CriUint32 max_height; /*EN< Maximum alpha height for stream */ + /*JP< At@t[̍ő卂 */ + CriUint32 disp_width; /*EN< valid alpha width */ + /*JP< At@t[̎L */ + CriUint32 disp_height; /*EN< valid alpha height */ + /*JP< At@t[̎L */ + CriUint32 framerate; /*EN< Frame rate per second [x1000]. */ + /*JP< At@̃t[[g[x1000] */ + CriUint32 framerate_n; /*EN< Frame rate (in rational as numerator). framerate_n/framerate_d = framerate */ /* UTODO: ϐ */ + /*JP< t[[g̕q(L`)Bframerate_n/framerate_d = framerate */ + CriUint32 framerate_d; /*EN< Frame rate (in rational as denominator). */ + /*JP< t[[g̕(L`)B */ + CriUint32 total_frames; /*EN< Total number of alpha frames */ + /*JP< t[ */ + CriMvAlphaType alpha_type; /*EN< Alpha Composite Type. */ + /*JP< At@ʁB */ + CriUint32 codec_type; /*EN< Internal use only. Do not access this */ + /*JP< Cugpϐ */ + CriUint32 color_conversion_type; /*EN< Color space converion type. Fullrange or Limited.*/ + /*JP< Fϊ^CvB */ + CriSint32 capacity_of_picsize; /*EN< Capacity size of video pictures. */ + /*JP< sN`TCYl */ + CriUint32 average_bitrate; /*EN< Average bitrate. */ + /*JP< σrbg[g */ +} CriMvAlphaParameters; + + +/*EN + * \brief Streaming Parameters + * \ingroup MDL_MV_INFO + * This structure includes streaming parameters and playing parameters. + * \sa CriMvEasyPlayer::GetMovieInfo() + */ +/*JP + * \brief Xg[~OĐp[^ + * \ingroup MDL_MV_INFO + * Xg[~OĐp[^B
+ * Xg[̂̏ƁAĐ̂߂ɕKvȃp[^̗܂łB + * \sa CriMvEasyPlayer::GetMovieInfo() + */ +typedef struct { + /* Stream */ + CriUint32 is_playable; /*EN< Flag of the movie file is playable or not. 1 is playable. 0 is not playable.*/ + /*JP< Д\tOi1: Д\A0: Đsj */ + CriFloat32 buffering_time; /*EN< Amount of time to buffer in the stream, in seconds */ + /*JP< ǂݍ݃f[^̃obt@OԁBP[sec]B */ + CriUint32 max_bitrate; /*EN< Maximum bits per second for stream. This value includes video and audio both. */ + /*JP< őrbg[g(GƉ̍v) */ + CriUint32 max_chunk_size; /*EN< Maximum chunk size of incoming stream (USF) file */ + /*JP< őUSF`NTCY */ + CriUint32 min_buffer_size; /*EN< Minimum buffer size for reading */ + /*JP< ŒKvȓǂݍ݃obt@TCYB
I[fBIƃrfI̍v */ + CriSint32 read_buffer_size; /*EN< Input buffer size for reading data */ + /*JP< [hobt@TCY */ + /* Video */ + CriUint32 num_video; /*EN< Number of simultaneous video streams */ + /*JP< rfIfR[_̐B݂1ŒB*/ + CriMvVideoParameters video_prm[CRIMV_MAX_VIDEO_NUM]; /*EN< Video parameters see CriMvVideoParameters struct for details */ + /*JP< rfIp[^ */ + /* Audio */ + CriUint32 num_audio; /*EN< Number of simultaneous audio streams */ + /*JP< I[fBIfR[_̐B݂1ŒB*/ + CriSint32 track_play_audio; /*EN< Track of audio playback. */ + /*JP< ĐI[fBI`lԍB-1wōĐB */ + CriMvAudioParameters audio_prm[CRIMV_MAX_AUDIO_NUM]; /*EN< Audio parameters see CriMvAudioParameters struct for details */ + /*JP< I[fBIp[^ */ + /* Subtitle */ + CriUint32 num_subtitle; /*EN< Number of subtitles */ + /*JP< `l */ + CriSint32 channel_play_subtitle; /*EN< Channel for playing subtitles */ + /*JP< Đ鎚`lԍ */ + CriUint32 max_subtitle_size; /*EN< Maximum size of subtitle data */ + /*JP< f[^̍őTCY*/ + + /* Composite mode */ + CriUint32 num_alpha; /*EN< Number of alpha channels (current spec allows only one) */ + /*JP< At@fR[_̐B݂1ŒB */ + CriMvAlphaParameters alpha_prm[CRIMV_MAX_ALPHA_NUM]; /*EN< Alpha parameters see CriMvAlphaParameters struct for details */ + /*JP< At@p[^ */ + + CriBool seekinfo_flag; /*EN< Flag of the movie file inclues seek info */ + /*JP< V[NtO */ + CriUint32 format_ver; /*EN< Format version */ + /*JP< tH[}bgo[W */ +} CriMvStreamingParameters; + + +/*EN + * \brief Input Buffer Information + * \ingroup MDL_MV_INFO + * \sa CriMvEasyPlayer::GetInputBufferInfo(), + * CriMvEasyPlayer::SetReloadThresholdTime(), CriMvEasyPlayer::SetBufferingTime() + */ +/*JP + * \brief ̓obt@ + * \ingroup MDL_MV_INFO + * \sa CriMvEasyPlayer::GetInputBufferInfo(), + * CriMvEasyPlayer::SetReloadThresholdTime(), CriMvEasyPlayer::SetBufferingTime() + */ +typedef struct { + CriUint32 buffer_size; /*EN< Input buffer size [byte] */ + /*JP< ̓obt@TCY[byte] */ + CriUint32 data_size; /*EN< Data size in input buffer[byte] */ + /*JP< ̓obt@ɂf[^TCY[byte] */ + CriUint32 reload_threshold; /*EN< Re-load threshold. When data size is less than re-load threshold, next read is requested. */ + /*JP< ēǂݍ臒l[byte]Bf[^TCY̒lȉɂȂƓǂݍ݂s܂B */ +} CriMvInputBufferInfo; + + +// TEMP: for internal use +typedef struct { + CriUint8 *imageptr; + CriUint32 bufsize; // [Byte] + CriUint32 line_pitch; // [Byte] + CriUint32 line_size; // [Byte] + CriUint32 num_lines; +} CriMvImageBufferInfo; + +/*EN + * \brief Video Frame Information + * \ingroup MDL_MV_INFO + * \sa CriMvEasyPlayer::GetFrameOnTimeAs32bitARGB(), CriMvEasyPlayer::GetFrameOnTimeAsYUVBuffers, + * CriMvEasyPlayer::GetFrameOnTimeAsYUV422(), CriMvEasyPlayer::DiscardNextFrame() + */ +/*JP + * \brief rfIt[ + * \ingroup MDL_MV_INFO + * rfIt[ + * \sa CriMvEasyPlayer::GetFrameOnTimeAs32bitARGB(), CriMvEasyPlayer::GetFrameOnTimeAsYUVBuffers, + * CriMvEasyPlayer::GetFrameOnTimeAsYUV422(), CriMvEasyPlayer::DiscardNextFrame() + */ +typedef struct { + CriUint8 *imageptr; /*EN< Pointer to image data */ + /*JP< 摜f[^̃|C^ */ + CriSint32 frame_id; /*EN< Frame ID ot the playback */ + /*JP< t[IDi[v^AĐ͒ʎZj */ + CriUint32 width; /*EN< Width of movie frame [pixel] (multiple of 8) */ + /*JP< [r̉[pixel] (W̔{) */ + CriUint32 height; /*EN< Height of movie frame [pixel] (multiple of 8) */ + /*JP< [r̍[pixel] (W̔{) */ + CriUint32 pitch; /*EN< Pitch of movie frame [byte]*/ + /*JP< [r̃sb`[byte] */ + CriUint32 disp_width; /*EN< Width of the image to draw. */ + /*JP< \f̉sNZi[j */ + CriUint32 disp_height; /*EN< Height of the image to draw. */ + /*JP< \f̏csNZi[j */ + CriUint32 framerate; /*EN< Frames per second times 1000 */ + /*JP< t[[g1000{̒l */ + CriUint32 framerate_n; /*EN< Frame rate (in rational as numerator). framerate_n/framerate_d = framerate */ /* UTODO: ϐ */ + /*JP< t[[g̕q(L`)Bframerate_n/framerate_d = framerate */ + CriUint32 framerate_d; /*EN< Frame rate (in rational as denominator). */ + /*JP< t[[g̕(L`)B */ + CriUint64 time; /*EN< Frame time ('time / tunit' indicates time in seconds) */ + /*JP< Btime / tunit ŕb\B */ + CriUint64 tunit; /*EN< Unit of time measurement */ + /*JP< P */ + CriUint32 cnt_concatenated_movie; /*EN< Number of concatenated movie data */ + /*JP< [r̘A */ + CriSint32 frame_id_per_data; /*EN< Frame ID of the movie data */ + /*JP< [rf[^Ƃ̃t[ԍ */ + + CriBool csc_flag; /*EN< This is temporary variable. Please don't access. */ + /*JP< eXg̕ϐłBANZXȂłB */ + + CriMvAlphaType alpha_type; /*EN< Composite mode */ + /*JP< At@̍[h*/ + + void *details_ptr[CRIMV_FRAME_DETAILS_NUM]; // for internal use + + CriSint32 num_images; // TEMP: for internal use + CriMvImageBufferInfo image_info[4]; // TEMP: for internal use + + CriUint32 color_conversion_type; /*EN< Color space converion type. Fullrange or Limited.*/ + /*JP< Fϊ^CvB */ + CriUint32 total_frames_per_data; /*EN< Total frames of the movie data*/ + /*JP< [rf[^Pʂ̑t[ */ + CriUint32 cnt_skipped_frames; /*EN< Number of skipped frames to decode */ + /*JP< fR[hXLbvꂽt[ */ +} CriMvFrameInfo; + +/*EN + * \brief Subtitle Information + * \ingroup MDL_MV_INFO + * \sa CriMvEasyPlayer::GetSubtitleOnTime() + */ +/*JP + * \brief + * \ingroup MDL_MV_INFO + * \sa CriMvEasyPlayer::GetSubtitleOnTime() + */ +typedef struct { + CriUint8 *dataptr; /*EN< Pointer to subtitle data */ + /*JP< f[^̃|C^ */ + CriUint32 data_size; /*EN< Size of subtitle data */ + /*JP< f[^TCY */ + CriSint32 channel_no; /*EN< Channel number of subtitle data */ + /*JP< f[^̃`lԍ */ + CriUint64 time_unit; /*EN< Unit of time measurement */ + /*JP< P */ + CriUint64 in_time; /*EN< Display start time */ + /*JP< \Jn*/ + CriUint64 duration_time; /*EN< Display duration time */ + /*JP< \ */ + CriUint32 cnt_concatenated_movie; /*EN< Number of concatenated movie data */ + /*JP< [r̘A */ + CriUint64 in_time_per_data; /*EN< Display start time per movie data*/ + /*JP< [rf[^Ƃɕ\Jn*/ +} CriMvSubtitleInfo; + +/*EN + * \brief Event Point Info + * \ingroup MDL_MV_INFO + * Event point info is the each timing info was embeded to movie data as cue point info. + * \sa CriMvEasyPlayer::GetCuePointInfo() + */ +/*JP + * \brief Cxg|Cg + * \ingroup MDL_MV_INFO + * L[|Cg@\Ń[rf[^ɖߍ܂ꂽX̃^C~OłB + * \sa CriMvEasyPlayer::GetCuePointInfo() + */ +typedef struct { + CriChar8 *cue_name; /*EN< The name string of event point. Char code depends on cue point text. */ + /*JP< Cxg|CgBR[h̓L[|CgeLXgɏ]܂B */ + CriUint32 size_name; /*EN< The data size of name string */ + /*JP< Cxg|Cg̃f[^TCY */ + CriUint64 time; /*EN< Timer counter */ + /*JP< ^C}JEg */ + CriUint64 tunit; /*EN< Counter per 1 second. "count / unit" indicates the timer on the second time scale. */ + /*JP< Pb̃^C}JEglBcount unit ŕbPʂ̎ƂȂ܂B */ + CriSint32 type; /*EN< Event point type */ + /*JP< Cxg|Cg */ + CriChar8 *param_string; /*EN< The string of user parameters. Char code depends on cue point text. */ + /*JP< [Up[^BR[h̓L[|CgeLXgɏ]܂B */ + CriUint32 size_param; /*EN< The data size of user parameters string */ + /*JP< [Up[^̃f[^TCY */ + CriUint32 cnt_callback; /*EN< The counter of calling cue point callback. */ + /*JP< L[|CgR[obŇĂяoJE^ */ +} CriMvEventPoint; + +/*EN + * \brief Cue Point Info + * \ingroup MDL_MV_INFO + * Cue point info includes the number of event points and the list. + * \sa CriMvEasyPlayer::GetCuePointInfo() + */ +/*JP + * \brief L[|Cg + * \ingroup MDL_MV_INFO + * L[|CǵACxg|CǧƈꗗłB
+ * \sa CriMvEasyPlayer::GetCuePointInfo() + */ +typedef struct { + CriUint32 num_eventpoint; /*EN< The number of event points */ + /*JP< Cxg|Cg */ + CriMvEventPoint *eventtable; /*EN< The list of event points */ + /*JP< Cxg|Cgꗗ */ +} CriMvCuePointInfo; + +/*EN + * \brief YUV Texture Buffer Parameters + * \ingroup MDL_MV_INFO + * The output buffer parameters for CriMvEasyPlayer::GetFrameOnTimeAsYUVBuffers(). + * CriMvEasyPlayer::GetFrameOnTimeAsYUVBuffers() outputs data for pixel shader.
+ * If an application doesn't play alpha movie, CRI Movie library doesn't use alpha buffer parameters.
+ * \sa CriMvEasyPlayer::GetFrameOnTimeAsYUVBuffers() + */ +/*JP + * \brief YUV•ʃobt@ + * \ingroup MDL_MV_INFO + * CriMvEasyPlayer::GetFrameOnTimeAsYUVBuffers() ̏o̓obt@łB
+ * CriMvEasyPlayer::GetFrameOnTimeAsYUVBuffers() Pixel Shader ̃fR[hʂo͂܂B
+ * At@[rĐsȂꍇis̒ʏĐj́AAlphaeNX`֘Ãp[^͎gp܂B
+ * \sa CriMvEasyPlayer::GetFrameOnTimeAsYUVBuffers() + */ +typedef struct { + CriUint8 *y_imagebuf; /*EN< Pointer to the buffer of Y texture */ + /*JP< YeNX`̃obt@|C^ */ + CriUint32 y_bufsize; /*EN< Size of the buffer of Y texture [byte] */ + /*JP< YeNX`̃obt@TCY[byte] */ + CriUint32 y_pitch; /*EN< Pitch of the buffer of Y texture [byte] */ + /*JP< YeNX`̃sb`[byte] */ + CriUint8 *u_imagebuf; /*EN< Pointer to the buffer of U texture */ + /*JP< UeNX`̃obt@|C^ */ + CriUint32 u_bufsize; /*EN< Size of the buffer of U texture [byte] */ + /*JP< UeNX`̃obt@TCY[byte] */ + CriUint32 u_pitch; /*EN< Pitch of the buffer of U texture [byte] */ + /*JP< UeNX`̃sb`[byte] */ + CriUint8 *v_imagebuf; /*EN< Pointer to the buffer of V texture */ + /*JP< VeNX`̃obt@|C^ */ + CriUint32 v_bufsize; /*EN< Size of the buffer of V texture [byte] */ + /*JP< VeNX`̃obt@TCY[byte] */ + CriUint32 v_pitch; /*EN< Pitch of the buffer of V texture [byte] */ + /*JP< VeNX`̃sb`[byte] */ + CriUint8 *a_imagebuf; /*EN< Pointer to the buffer of Alpha texture */ + /*JP< AlphaeNX`̃obt@|C^ */ + CriUint32 a_bufsize; /*EN< Size of the buffer of Alpha texture [byte] */ + /*JP< AlphaeNX`̃obt@TCY[byte] */ + CriUint32 a_pitch; /*EN< Pitch of the buffer of Alpha texture [byte] */ + /*JP< AlphaeNX`̃sb`[byte] */ +} CriMvYuvBuffers; + + +/*EN + * \brief Playback Information + * \ingroup MDL_MV_INFO + * The output playback information of CriMvEasyPlayer::GetPlaybackInfo(). + * These parameters represents current movie playback information such as decode delay of movie data and + * interval of video frames retrieval. + * \sa CriMvEasyPlayer::GetPlaybackInfo() + */ +/*JP + * \brief Đ + * \ingroup MDL_MV_INFO + * CriMvEasyPlayer::GetPlaybackInfo() ̏o͍ĐłB
+ * t[̎擾ԊufR[h̒xȂǂ̌ݍĐĂ郀[r̍Đ\܂B
+ * \sa CriMvEasyPlayer::GetPlaybackInfo() + */ +typedef struct { + CriUint64 cnt_app_loop; /*EN< Loop count of application. Precisely, this is a number of calls of CriMvEasyPlayer::Update(). The count up will start after app is able to acquire the first video frame */ + /*JP< AvP[Ṽ[vJEgB̓Iɂ CriMvEasyPlayer::Update() ̌Ăяo񐔂ɂȂ܂Bŏ̃t[擾”\ɂȂƃJEgn܂܂B*/ + CriUint64 cnt_frame_interval[4]; /*EN< Interval of video frames retrieval. These values are count up when CriMvEasyPlayer::IsNextFrameOnTime() returns TRUE. + * + * The interval of video frames retrieval indicates a number of the loop count when your application calls CriMvEasyPlayer::IsNextFrameOnTime() in the main loop. + * In case that the application waits for vertical retrace, 1 interval equals about 16.7 msec. + * The index of array represents the count of intervals as follows: + * + *
Index Interval of video frames retrieval + *
0 Every main loop + *
1 2 main loops + *
2 3 main loops + *
3 4 or more main loops + *
+ * With these values, you can check if the application gets video frames with appropriate intervals. Please use the values as measuring playback smoothness + * + * In order to use these values, the application must meet the following conditions: + * - The main loop should work periodically and stably (Ideally sync with vertical retrace) + * - The application should call CriMvEasyPlayer::IsNextFrameOnTime() once in everly main loop + * + * For example, if the application runs at 59.94fps by waiting for vertical retrace and a framerate of playing movie file is 29.97fps, + * only cnt_frame_interval[1] should be increased. + */ + /*JP< t[̎擾ԊuB̒ĺA CriMvEasyPlayer::IsNextFrameOnTime() TRUEԂɃJEgAbv܂B
+ * + * t[̎擾ԊuƂ́AAvP[VC[vŃt[擾֐ǂ񂾎̃[v̉񐔂Ӗ܂B + * C[vVSyncƓĂꍇ́A1 Interval = 16.7msecƂƂɂȂ܂B + * z̃CfbNX́Aȉ̂悤Ɏ擾Ԋu\܂B
+ * + *
CfbNX t[̎擾Ԋu + *
0 C[v + *
1 2 C[v + *
2 3 C[v + *
3 4 C[vȏ + *
+ * ̒l邱ƂŁAAvԊuŃt[擾ł̂ǂ`FbN邱Ƃł܂B[r炩ɍĐłĂ邩̖ڈɂĂB
+ * + * OƂāAȉ̏AvĂKv܂B + * - AvVSyncȂǁA̎ň肵ē삵Ă + * - C[vŖ CriMvEasyPlayer::IsNextFrameOnTime() Ăяo + * + * L̏ɂāAႦ΃Av59.94fpsœ삵ĂԂŁAt[[g29.97fps̃[rĐꍇAcnt_frame_interval[1]݂̂ + * ԊuŃt[̎擾oƂɂȂ܂B + */ + CriUint64 cnt_time_early; /*EN< A count of how many times CriMvEasyPlayer::IsNextFrameOnTime() returns FALSE due to the determination if it is the time to provide the next video frame */ + /*JP< CriMvEasyPlayer::IsNextFrameOnTime() At[\ɂFALSEԂ񐔁B*/ + CriUint64 cnt_decode_delay; /*EN< A count of how many times CriMvEasyPlayer::IsNextFrameOnTime() returns FALSE due to the delay of decoding movie data */ + /*JP< CriMvEasyPlayer::IsNextFrameOnTime()ArfIt[̃fR[hxɂFALSEԂ */ + CriFloat32 time_max_delay; /*EN< Maximum delay time [msec] of the actual time a video frame retrieved against the original time should be retrieved */ + /*JP< rfIt[擾ۂ̎ƁA{\ׂƂ̍őx [msec]B */ + CriFloat32 time_average_delay; /*EN< Average delay time [msec] of the actual time a video frame retrieved against the original time should be retrieved */ + /*JP< rfIt[擾ۂ̎ƁA{\ׂƂ̕ϒx [msec]B */ +} CriMvPlaybackInfo; + +#if defined(XPT_TGT_PS3PPU) +/*EN + * \brief Parameters of SPURS and PPU for decoding + * \ingroup MDL_MV_BASIC + * + * \sa CriMv::SetupSpursParameters_PS3(), CriMv::CalcSpursWorkSize_PS3() + */ +/*JP + * \brief fR[hɎgSPURSPPŨp[^ + * \ingroup MDL_MV_BASIC + * + * \sa CriMv::SetupSpursParameters_PS3(), CriMv::CalcSpursWorkSize_PS3() + */ +typedef struct { + void *spurs_handler; /*EN< SPURS handler */ + /*JP< SPURSnh */ + void *spurs_work; /*EN< SPURS work area. The size is spurs_worksize. The alignment is 128 byte. */ + /*JP< SPURSp[Nobt@Bobt@TCY spurs_worksize 128oCgEB */ + CriSint32 spurs_worksize; /*EN< SPURS work size. This size is calculated by CriMv::CalcSpursWorkSize_PS3 function. */ + /*JP< SPURSp[NTCYBCriMv::CalcSpursWorkSize_PS3 ֐Ŏ擾lB */ + CriSint32 spurs_max_contention; /*EN< SPURS max contention */ + /*JP< SPURS Ń[rfR[hpɎgSPU̍ő吔 */ + CriUint8 *spurs_task_priority; /*EN< SPURS task priority x 8 */ + /*JP< SPURS ̃^XNvCIeBzBzvf͂WB */ + + CriUint32 ppu_num; /*EN< The number of PPU for decoding (0-2) */ + /*JP< The number of PPU for decoding (0-2) */ + CriSint32 ppu_thread_prio; /*EN< PPU Thread Priority. This priority is used for decoding thread in the case of ppu_num equal 2. */ + /*JP< PPU Thread Priority. ̒l ppu_num 2w肵ꍇɍ쐬XbhɎgB */ +} CriMvProcessorParameters_PS3; + +// [NOT SUPPORT on normal library] +// for SPU Thread +typedef struct { + CriUint32 ppu_num; /* The number of PPU for decoding (0-2) */ + CriSint32 ppu_prio; /* PPU Thread Priority */ + CriUint32 spu_num; /* The number of SPU for decoding (0-6) */ + CriSint32 spu_grp_prio; /* SPU Thread Group Priority */ +} CriMvSpuThreadParameters_PS3; + +#endif + +#if defined(XPT_TGT_XBOX360) +/*EN + * \brief Parameters of Xbox360 processors for decoding + * \ingroup MDL_MV_BASIC + * + * \sa CriMvEasyPlayer::SetUsableProcessors_XBOX360() + */ +/*JP + * \brief fR[hɎgXbox360vZbT̃p[^ + * \ingroup MDL_MV_BASIC + * + * \sa CriMvEasyPlayer::SetUsableProcessors_XBOX360() + */ +typedef struct { + CriBool processor0_flag; /*EN< Processor 0 (Core 0, Thread 0) usable flag */ + /*JP< vZbT0 (RA0Xbh0) gp”\tO */ + CriBool processor1_flag; /*EN< Processor 1 (Core 0, Thread 1) usable flag */ + /*JP< vZbT1 (RA0Xbh1) gp”\tO */ + CriBool processor2_flag; /*EN< Processor 2 (Core 1, Thread 0) usable flag */ + /*JP< vZbT2 (RA1Xbh0) gp”\tO */ + CriBool processor3_flag; /*EN< Processor 3 (Core 1, Thread 1) usable flag */ + /*JP< vZbT3 (RA1Xbh1) gp”\tO */ + CriBool processor4_flag; /*EN< Processor 4 (Core 2, Thread 0) usable flag */ + /*JP< vZbT4 (RA2Xbh0) gp”\tO */ + CriBool processor5_flag; /*EN< Processor 5 (Core 2, Thread 1) usable flag */ + /*JP< vZbT5 (RA2Xbh1) gp”\tO */ + CriSint32 thread_priority; /*EN< Priority of decoding threads on the active processors */ + /*JP< evZbTŃfR[hsXbh̗Dx */ +} CriMvProcessorParameters_XBOX360; +#endif + +#if defined(XPT_TGT_VITA) +/*EN + * \brief AVC Decoder Parameters + * \ingroup MDL_MV_BASIC + * + * \sa CriMv::SetupAvcDecoderParameters_VITA() + */ +/*JP + * \brief AVCfR[_p[^ + * \ingroup MDL_MV_BASIC + * + * \sa CriMv::SetupAvcDecoderParameters_VITA() + */ +typedef struct { + CriUint32 horizontal; /*EN< Maximum width for decoding (in pixel) */ + /*JP< őfR[h摜̉ (PʁFsNZ) */ + CriUint32 vertical; /*EN< Maximum height for decoding (in pixel) */ + /*JP< őfR[h摜̍ (PʁFsNZ) */ + CriUint32 n_ref_frames; /*EN< Maximum reference frames on decoding (default:3) */ + /*JP< fR[h̍őQƉ摜̖ */ + CriUint32 n_decoders; /*EN< Maximum number of avc decoders (max:1) */ + /*JP< ɎgpAVCŃR[_̍ő吔 (1Œ) */ + +} CriMvAvcDecoderParameters_VITA; +#endif + +/*--------------------------------------------------------------------------*/ +/* */ +/*--------------------------------------------------------------------------*/ +typedef enum { + CRIMV_PCM_FORMAT_SINT16 = 0, + CRIMV_PCM_FORMAT_FLOAT32 = 1, + + /* Keep enum 4bytes */ + CRIMV_PCM_FORMAT__MAKE_ENUM_SINT32 = 0x7FFFFFFF +} CriMvPcmFormat; +/* + * \brief 16bit wave data information + * \ingroup MDL_MV_INFO + * Information about a 16-bit waveform. + */ +/* 16bit Waveform */ +typedef struct { + CriUint32 num_channel; /* Number of Channels. monaural = 1, stereo = 2 */ + /* Number of Channels. monaural = 1, stereo = 2 */ + CriUint32 num_samples; /* Number of sample */ + /* Tv */ + CriUint32 sampling_rate; /* Sampling rate */ + /* TvOg */ +} CriMvWaveInfo; + +/* I[fBIwb_ */ +typedef struct { + /* Xg[~Op[^Ƌ */ + CriUint32 sampling_rate; + CriUint32 num_channel; + CriUint32 total_samples; + CriUint32 codec_type; + + CriUint32 metadata_count; + CriUint32 metadata_size; + + /* wb_ŗL */ + CriUint32 a_input_xsize; +} CriMvPlyAudioHeader; + +/* rfIwb_ */ +typedef struct { + /* wb_ŗL */ + CriUint32 width; + CriUint32 height; + CriUint32 disp_width; + CriUint32 disp_height; + CriUint32 framerate_n; + CriUint32 framerate_d; + CriUint32 total_frames; + + CriUint32 material_width; /* width of video original source. 0 means no info. */ + CriUint32 material_height; /* height of video original source. 0 means no info. */ + CriUint32 screen_width; /* screen width for Wii */ + + CriUint32 codec_type; + CriUint32 codec_dc_option; /* 11 or 10 */ + + CriUint32 metadata_count; + CriUint32 metadata_size; + + CriUint32 pre_padding; + CriUint32 color_conversion_type; + CriSint32 max_picture_size; + CriSint32 average_bitrate; +} CriMvPlyVideoHeader; + +/* Tu^Cgwb_ */ +typedef struct { + CriBool is_subtitle_data; + CriUint32 num_channel; + CriUint64 time_unit; + CriUint32 max_subtitle_size; +} CriMvPlySubtitleHeader; + +/* L[|Cgwb_ */ +typedef struct { + CriBool is_cuepoint_data; + CriUint32 metadata_count; + CriUint32 metadata_size; + CriUint32 num_eventpoint; + CriUint64 time_unit; +} CriMvPlyCuePointHeader; + +/* At@wb_ */ +typedef struct { + /* wb_ŗL */ + CriUint32 width; + CriUint32 height; + CriUint32 disp_width; + CriUint32 disp_height; + CriUint32 framerate_n; + CriUint32 framerate_d; + CriUint32 total_frames; + + CriMvAlphaType alpha_type; + CriUint32 codec_type; + + CriUint32 metadata_count; + CriUint32 metadata_size; + + CriUint32 pre_padding; + CriUint32 color_conversion_type; + CriSint32 max_picture_size; + CriSint32 average_bitrate; +} CriMvPlyAlphaHeader; + +/* At@݂̂̃t[ */ +typedef struct { + CriUint8 *imageptr; /*EN< Pointer to image data */ + /*JP< 摜f[^̃|C^ */ + CriSint32 frame_id; /*EN< Frame ID */ + /*JP< t[ID */ + CriUint32 width; /*EN< Width of movie frame [pixel] */ + /*JP< [r̉[pixel] */ + CriUint32 height; /*EN< Height of movie frame [pixel] */ + /*JP< [r̍[pixel] */ + CriUint32 disp_width; /*EN< Width of image [pixel] */ + /*JP< Lȉf̉[pixel] */ + CriUint32 disp_height; /*EN< Height of image [pixel] */ + /*JP< Lȉf̍[pixel] */ + CriUint32 pitch; /*EN< Pitch of movie frame [byte]*/ + /*JP< [r̃sb`[byte] */ + CriUint64 time; /*EN< Frame time ('time / tunit' indicates time in seconds) */ + /*JP< Btime / tunit ŕb\B */ + CriUint64 tunit; /*EN< Unit of time measurement */ + /*JP< P */ + CriSint32 frame_id_per_data; /*EN< Frame ID of the movie data */ + /*JP< [rf[^Ƃ̃t[ԍ */ + CriMvAlphaType alpha_type; /*EN< Composite mode */ + /*JP< At@̍[h*/ + void *detail_ptr; /* TEMP: for internal use */ + CriUint32 color_conversion_type; /*EN< Color space converion type. Fullrange or Limited.*/ + /*JP< Fϊ^CvB */ +} CriMvAlphaFrameInfo; + +// ǗpB[r[Uɓn͂Ƃقړ낤B +/* Information of USF File */ +typedef struct { + CriBool is_usf_file; + CriUint32 max_chunk_size; + CriUint32 min_buffer_size; + CriUint32 bitrate; + CriUint32 format_version; + /* Video */ + CriUint32 num_video; + CriMvPlyVideoHeader videohead[CRIMV_MAX_VIDEO_NUM]; + /* Audio */ + CriUint32 num_audio; + CriMvPlyAudioHeader audiohead[CRIMV_MAX_AUDIO_NUM]; + /* Subtitle */ + CriUint32 num_subtitle; + CriMvPlySubtitleHeader subtitlehead; + /* Alpha */ + CriUint32 num_alpha; + CriMvPlyAlphaHeader alphahead[CRIMV_MAX_ALPHA_NUM]; + /* CuePoint */ + CriUint32 num_cuepoint; + CriMvPlyCuePointHeader cuepointhead; +} CriMvPlyHeaderInfo; + +/* Video Elementary Stream */ +typedef struct { + CriUint32 fcid; + CriSint32 track_no; // `Ñ`lԍ + void *vdec; +} CriMvPlyVideo; + +typedef struct { + CriUint32 fcid; + CriSint32 track_no; // `Ñ`lԍ + void *dec; +} CriMvPlyAlpha; + +/* [rwb_Ǘ邽߂̍\ */ +typedef struct { + CriMvPlyHeaderInfo info; + CriBool write_new_head_flag; // CRID‚Ď̃wb_ޏłH + CriUint32 num_remaining_adec_head; // KvȎc̃I[fBIwb_̐ + CriUint32 num_remaining_vdec_head; // KvȎc̃rfĨwb_̐ + CriUint32 num_remaining_subtitle_head; // KvȎc̎̃wb_̐ + CriUint32 num_remaining_alpha_head; // KvȎc̃At@̃wb_ + CriUint32 num_remaining_cuepoint_head; // KvȎc̃L[|Cg̃wb_ + /* 2010-08-19: TEMP: CONCAT_KAI: Don't refer this member. */ + CriUint64 accumulated_tcount; +} CriMvHeaderInfoContainer; + +typedef struct { + CriBool is_play_audio; + CriUint32 fcid; + CriUint32 track_no; // `Ñ`lԍ + void *adec; // ۂ̃I[fBIR[fbN + CriUint32 num_channel; // f[^̃`l + CriUint32 sampling_rate; // TvOg + CriUint32 output_buffer_samples; + CriSj sji; // UNI + CriSj sjo[CRIMV_PCM_BUFFER_MAX]; // RBF + CriUint32 sjo_bufsize[CRIMV_PCM_BUFFER_MAX]; + CriBool term_supply; // f[^IʒmtO + CriBool is_working; // Rec`N + +#if defined(ENABLE_DYNAMIC_AUDIO_SWITCH) + CriUint32 next_track_no; // [Uw肵ؑ֐̃gbNԍ + CriUint32 last_track_switch_time; // ؑ֌̃gbN̍ŌɃ`NƂ + CriUint32 last_track_switch_tunit; // L̒P (in Hz?) + CriMvPlyAmngTrackState switch_state; // gbNؑւɂ +#endif +} *CriMvPlyAdec, CriMvPlyAdecObj; + +typedef struct { + + CriMvPlyAdec mvply_adecs[NUM_MAX_ADEC]; + CriSint32 num_adecs; + CriUint32 size_smpl; + CriSj sji; + CriUint32 chunk_num_per_server; + + CriBool (*cbfunc_nofify_found_header)(void *usrobj, CriChunk *ckc, CriUint8 chno); + void *usrobj_nofify_found_header; + +} *CriMvPlyAmng, CriMvPlyAmngObj; + + +/* V[NubN */ +typedef struct { + CriSint32 top_frame_id; +} CriMvSeekBlockInfo; + +/* Xg[}p */ +typedef struct { + CriUint32 max_chunk_size; + CriUint32 average_bitrate; +} CriMvStreamerInfo; + + +/* nh쐬pRtBO\ */ +typedef struct { + CriUint32 readbuffer_size; +} CriMvHandleConfig; + + +/*JP CRI Movie nh */ +/*EN + * A handle for a single movie. If multiple movies are to be played simultaneously, + * create a CriMvPly handle for each movie. + * + * \sa criMvPly_Create(), criMvPly_Destroy() */ +typedef struct { + /*** Member variable is ***/ + CriBool used; + CriMvPlyStatus stat; + CriBool request_stop; + CriBool restrain_supply; + CriBool term_supply; + void *cs_work; + void *cshn; + /* USF Header */ + + CriMvHeaderInfoContainer headinfo_container[CRIMVPLY_HEAD_CONTAINER_NUM]; + Uint16 cur_dechead_idx; + CriUint32 cnt_dechead; /* wb_͂ƂɍXV */ + CriUint32 cnt_concat; /* GetFrameōXV */ + + CriMvPlyHeaderInfo headinfo; + CriUint32 num_headck; /* wb_͏`N */ + CriFloat32 def_buffering_time; + CriUint32 def_max_stream; + CriUint32 def_sound_output_buffer_samples; + CriSint32 def_track_play_audio; /* -1 ŃI[fBIĐ */ + + /* fQ[gp[^\ */ + CriSint32 size_dlgparams; + CriUint8 *ptr_dlgparams; + + CriBool is_prepare_work; + CriMvStreamingParameters stmprm; /* Xg[~Op[^̋L^ */ + /* Demultiplexer */ + CriSint32 inputtype; /* Xg[~OHjriĐ */ + CriBool is_usf_data; /* ̓t@CUSFt@CH */ + void *demux; /* USFf}`vNTnh */ + CriUint32 max_demuxout; /* f}`vNTo͂̍őʐ */ + CriUint32 num_demuxout; /* f}`vNTo͂ɐݒς݂̎ʐ */ + CriSj headanaly_in_sj; // RBF + CriSj headanaly_out_sj; // UNI + CriSj read_sj; // RBF + CriChunk readck; + + CriSj memplay_sj; // UNI (for memory playback) + CriChunk movie_on_mem; /* w̃[rf[^LpiPj */ + CriUint32 offset_content; /* w擪f[^̃Rec{̂܂ł̃TCY */ + + /* === nh쐬Ɋm === */ + CriHeap heap_gen; + /* wb_͗p̓ǂݍݗ̈ */ + CriUint32 headanaly_bufsize; + /* nh͍ŏ10kbytemۂĎg܂킷B̓Iɂ̓wb_͗pB */ + CriHeap local_heap; /* nhpHeap */ + CriSint32 local_bufsize; /* nhpHeapp̃obt@TCY */ + CriUint8 *local_bufptr; /* nhpHeapp̃obt@|C^ */ + /* === ^[Nobt@ (wb_͎Ɋm) === */ + CriHeap heap_meta; + /* === [Nobt@쐬Ɋm === */ + CriHeap heap_core; + /* ǂݍ݃obt@ */ + CriUint32 size_readbuf_main; + CriUint32 size_readbuf_ext; + /* Video Decoder */ + CriMvPlyVideo video; + CriUint32 framerate_n; + CriUint32 framerate_d; + /* Audio Decoder */ + CriMvPlyAmng audio_mngr; + CriMvPcmFormat pcmfmt; + CriUint32 size_smpl; + CriHeap heap_audio2; + /* Subtitle */ + CriSj sjo_subtitle; + CriSint32 concat_subtitle_cnt; /* ̘A */ + CriSint32 ch_subtitle; /* ̘A */ + /* Alpha */ + CriMvPlyAlpha alpha; + + /* ܂Ԃ`NΉpigǂɊ֌WȂϐ͒`j */ + CriUint32 bufsize_read_main; /* SJ̃obt@{̃TCY */ + CriUint32 bufsize_read_ext; /* SĴ̂肵TCY */ + CriUint8 *read_sj_bufptr; /* RBSJ̐擪obt@AhX */ + + /* Xg[~Op[^ɓƂiAH */ + CriSint32 seek_frame_id; /* V[Nt[IDiGOP̓r̉”\j */ + CriSint32 video_gop_top_id; /* V[ÑrfIGOP擪t[ID : 0ȉŃV[N */ + CriSint32 alpha_gop_top_id; /* V[ÑAt@GOP擪t[ID : 0ȉŃV[N */ + CriBool seek_video_prep_flag; /* V[NĐ̃rfItOiGOPr܂Ői񂾂Hj */ + CriBool seek_alpha_prep_flag; /* V[NĐ̃At@tOiGOPr܂Ői񂾂Hj */ + CriBool seek_audio_prep_flag; /* V[NĐ̃I[fBItOiV[Nw莞܂Ŏ̂ĂHj */ + + CriSint32 dechdr_stage; /* DECHDR̐i݋ */ + CriSint32 sji_meta_bufsize; /* ^f[^p̓obt@TCY */ + CriSj sji_meta; /* ^f[^pSJ */ + CriUint32 cnt_meta_ck; /* ^f[^pSJ */ + void *video_seektbl_ptr; + CriUint32 video_seektbl_size; + CriSint32 video_gop_num; + void *alpha_seektbl_ptr; + CriUint32 alpha_seektbl_size; + CriSint32 alpha_gop_num; + + void *audio_header_ptr[CRIMV_MAX_AUDIO_NUM]; + CriUint16 audio_header_size[CRIMV_MAX_AUDIO_NUM]; + + void *cuepoint_meta_ptr; + CriUint32 cuepoint_meta_size; + CriMvCuePointInfo cuepoint_info; + + CriMvInputBufferInfo ibuf_info; + CriFloat32 reload_sec_threshold; + + CriSint32 num_frames_for_prep; + + /* For Sofdec2 */ + CriHeap heap_playback; + CriMvMetaDataWorkMallocFunc cbfunc_meta_alloc; + CriMvMetaDataWorkFreeFunc cbfunc_meta_free; + void* usrobj_meta_data; + void* meta_data_work_allocated; /* [UAP[^Ŋmۂꂽ^f[^[N */ + void* event_table_work_allocated; /* [UAP[^ŊmۂꂽCxge[u */ + CriMvStreamerInfo streamer_info; + + /* OUTER_FRAMEPOOL_WORK */ + CriMvFramepoolWorkMallocFunc cbfunc_framepool_alloc; + CriMvFramepoolWorkFreeFunc cbfunc_framepool_free; + void* usrobj_framepool; + void* framepool_work_allocated; /* [UAP[^Ŋmۂꂽt[v[[NiKvj */ + void* framepool_work_set; /* ڃobt@w肳ꂽt[v[[Nisvj */ + + /* For Debug */ + volatile CriUint8 end_sequence_info; + CriUint64Adr header_ptr; + CriSint64 header_size; + CriUint64Adr body_ptr; + CriSint64 body_size; + + CriBool sync_flag; + + CriBool error_flag; + +#if defined(XPT_TGT_IOS) + CriChar8 vavfios_filepath[CRIMVPLY_VAVFIOS_MAX_FILEPATH]; +#endif + + /* For Tools */ + void *extended_mvinfo_config; + + /* nh쐬RtBO֘A */ + CriBool use_hn_config_flag; /* nh쐬RtBOw肪ǂ */ + CriMvHandleConfig hn_config; + +} *CriMvPly, CriMvPlyObj; + +/*************************************************************************** + * Function Declaration + ***************************************************************************/ + +#ifdef __cplusplus +extern "C" { +#endif + +/* Cu */ +/* + * \brief Cȕ + * \param Ȃ + * \return Ȃ + * \par : + * Cȕs܂B
+ * Aŏꍇ́Aŏ̂P̂ݏs܂B + */ +/* + * \ingroup MODULE_INIT + * \brief Initialize library + * + * This function initializes the CRI Movie library, including internal audio, + * streaming and video subsystems. This function must be + * called before any other function in this library will work properly. + * This function initializes only the first time it is called; if it is + * called again, it simply increments an internal counter and returns; it + * does not re-initialize, nor does it create an error condition. + * + * Therefore, it is safe to call criMvPly_Initialize() and criMvPly_Finalize() + * at the beginning and end, respectively, within each of the independent + * modules in your program. If you match these functions call for call, + * only the first criMvPly_Initialize() function and the last criMvPly_Finalize() + * functions should have any effect. + * + * \sa criMvPly_Finalize() + */ +void CRIAPI criMvPly_Initialize(void); + +/* CuI */ +/* + * \brief CuI + * \param Ȃ + * \return Ȃ + * \par : + * CȕIs܂B
+ * 񏉊Ăꍇ́A񐔂IsĂB + */ +/* + * \ingroup MODULE_INIT + * \brief Finalize library + * + * This function deallocates any resources in use by the library. + * It should be called the same number of times that the criMvPly_Initialize() + * function is called. If the criMvPly_Initialize() function is called n + * times, on the nth time the criMvPly_Finalize() function is called, + * criMvPly_Finalize() releases any resources allocated by CRI Movie. + * + * Therefore, it is safe to call criMvPly_Initialize() and criMvPly_Finalize() + * at the beginning and end, respectively, within each of the independent + * modules in your program. If you match these functions call for call, + * only the first criMvPly_Initialize() function and the last criMvPly_Finalize() + * functions should have any effect. + * + * \sa criMvPly_Initialize() + */ +void CRIAPI criMvPly_Finalize(void); + +/* nh쐬 */ +/* + * \brief nh쐬 + * \param heap : mۂɎgpHeapnh + * \return CriMvPlynh + * \par : + * CRI Movie nh쐬܂B
+ * KvȃnhǗ̈HeapnhgĎIɊmۂ܂B
+ * 쐬̃nhԂSTOPԂłB + */ +/* + * \ingroup MODULE_INIT + * \brief Create a handle + * \param heap A valid CriHeap handle + * \return A valid CriMvPly handle, or NULL if the handle cannot be allocated + * + * This function creates a CriMvPly handle in the CRIMVPLY_STATUS_STOP state. + * Memory for the handle is allocated from the CriHeap structure that you provide. + * Any memory allocation failure during this function results in a text error message to output, and the program hangs. + * Make sure to initialize and create your heap with criHeap_Initialize() and + * criHeap_Create() before calling this function. + * + * \sa CriMvPly, CriMvPlyStatus, criHeap_Initialize(), criHeap_Create() + */ +CriMvPly CRIAPI criMvPly_Create(CriHeap heap); + +/* RtBOw̃nh쐬 */ +/* config NULLw̏ꍇ̓RtBOw薳Ɠl */ +CriMvPly CRIAPI criMvPly_CreateWithConfig(CriHeap heap, CriMvHandleConfig *config); + +/* nhj */ +/* + * \brief nhj + * \param mvply : CRI Movie nh + * \return Ȃ + * \par : + * CRI Movie nh̔js܂B
+ * nh쐬ɈŎw肵HeapnhgāAnhǗ̈܂B
+ * [Nobt@mۂ܂܂̏ꍇ́A[Nobt@mێɎw肵Heapnhgă[Nobt@܂B
+ * nh̔j́AnhԂSTOPPLAYEND̎ɂsł܂B + */ +/* + * \ingroup MODULE_INIT + * \brief Destroy a handle + * \param mvply A valid CriMvPly handle to be destroyed + * + * This function destroys the CriMvPly handle previously created + * with criMvPly_Create(). + * + * You can only destroy the handle if it is in either the CRIMVPLY_STATUS_STOP or the + * the CRIMVPLY_STATUS_PLAYEND states. Attempting to destroy the handle in + * any other state will produce an error message. You can check the status of + * the handle at any time with criMvPly_GetStatus(). + * + * Any work buffers allocated via criMvPly_AllocateWorkBuffer(), if they are + * still associated with the handle, are freed when criMvPly_Destroy() is called. + * + * \sa CriMvPly, CriMvPlyStatus, criMvPly_GetStatus(), criMvPly_AllocateWorkBuffer() + */ +void CRIAPI criMvPly_Destroy(CriMvPly mvply); + +/* Xg[~Op[^̎擾 */ +/* + * \brief Xg[~Op[^̎擾 + * \param mvply : CRI Movie nh + * \param stmprm : Xg[~Op[^ + * \return Ȃ + * \par : + * wb_͂̌ʂƂɁA[rĐɕKvȃXg[~Op[^擾܂B
+ * nhԂWAIT_PREPɂȂƎ擾ł悤ɂȂ܂B
+ * ̃p[^ƂcriMvPly_AllocateWorkBuffer֐ĂяoƂł܂B
+ * KvȂ΂̃p[^̒lύXāAႦΉ胀[rʼnĐȂAƂƂ”\łB
+ */ +/* + * \ingroup MODULE_BUFFER + * \brief Get streaming parameters + * \param mvply A valid CriMvPly handle + * \param stmprm An empty CriMvStreamingParameters structure to be filled with data + * + * This function permits you to get detailed information about the stream and + * dynamically allocate resources just before the video and audio sequence + * begins playback. + * + * This function does nothing if the current state of the CriMvPly handle is + * CRIMVPLY_STATUS_DECHDR or CRIMVPLY_STATUS_STOP. The only useful state in + * which to call criMvPly_GetStreamingParameters() is the CRIMVPLY_WAIT_PREP + * status. When the CriMvPly handle is in the CRIMVPLY_WAIT_PREP status, + * calling this function will cause the CriMvStreamingParameters field to be + * filled with data. + * + * Some of the CriMvStreamingParameters, such as buffering time and the + * maximum number of files to read, are copied from the CriMvPly structure. + * However, maximum bitrate, video size, audio stream rate and channel + * info are calculated from the incoming stream. + * + * After calling criMvPly_GetStreamingParameters(), you can programmatically + * override any of the fields in the CriMvStreamingParameters struct yourself + * before calling criMvPly_AllocateWorkBuffer() with it. For example, you might + * need to read a stream containing both audio and video, but only output the + * video from the stream. In this case you could allocate trivial audio buffers + * for output by modifying the CriMvStreamingParameters struct accordingly after + * calling this function. + * + * \sa criMvPly_AllocateWorkBuffer(), CriMvPly, CriMvStreamingParameters + */ + void CRIAPI criMvPly_GetStreamingParameters(CriMvPly mvply, CriMvStreamingParameters *stmprm); + +/* [Nobt@̊m */ +/* + * \brief [Nobt@̊m + * \param mvply : CRI Movie nh + * \param heap : + * \param stmprm : Xg[~Op[^ + * \return Ȃ + * \par : + * HeapnhgāAǂݍ݃obt@rfI^I[fBĨ[Nobt@mۂ܂B
+ * ̊֐Ăяo”\Ȃ̂́ASTOPԂWAIT_PREPԂ݂̎̂łB
+ * nhɑ΂ĂQxĂяoƁAPxڂ̃[Nobt@SĉĂA߂ă[Nobt@mۂ܂B
+ * criMvPly_Start֐Ƀ[Nobt@mۂĂƂł܂B + */ +/* + * \ingroup MODULE_BUFFER + * \brief Allocate internal streaming work buffers + * \param mvply A CriMvPly handle + * \param heap A CriHeap handle + * \param stmprm An initialized CriMvStreamingParameters structure + * + * This function allocates internal streaming buffers for the CriMvPly movie + * player from the CriHeap. The amount of memory required is based + * on the maximum bitrate of the stream, the requested buffering time, the + * maximum chunk size, and the height and width of the incoming video frame. + * However, a small amount of memory is allocated for the + * video and audio decoders from the CriHeap as well. + * + * The CriHeap handle passed as a parameter to this function need not + * be the same CriHeap handle you passed to the criMvPly_Create() function. + * You may prefer to use either one or two heaps. + * + * This function can be called only if the CriMvPly handle is in the + * CRIMVPLY_STATUS_STOP or the CRIMVPLY_STATUS_WAIT_PREP status. Calling + * this function any other time will produce an error message. + * + * If this function is called twice without calling criMvPly_FreeWorkBuffer(), + * it releases the previously allocated buffers before allocating them again. + * + * This function must be called sometime before criMvPly_Start(). + * + * \if ps2 + * \par PS2 only: + * The PS2 implementation of this function additionally allocates buffers for + * internal DMA tags. If these allocations fail due to lack of memory, the + * library will hang. + * \endif + * + * \sa CriMvPly, CriHeap, CriMvPlyStatus, CriMvStreamingParameters, criMvPly_FreeWorkBuffer(), + * criMvPly_Start() + */ +CriBool CRIAPI criMvPly_AllocateWorkBuffer(CriMvPly mvply, CriHeap heap, CriMvStreamingParameters *stmprm); + +/* [Nobt@̉ */ +/* + * \brief [Nobt@̉ + * \param mvply : CRI Movie nh + * \return Ȃ + * \par : + * criMvPly_AllocateWorkBuffer֐Ŋmۂ[Nobt@Sĉ܂B
+ * ̊֐Ăяo”\Ȃ̂́ASTOP^WAIT_PREP^PLAYENDԂ݂̎̂łB
+ * CRI Movie Ver.0.60 ł͖łB + */ +/* + * \ingroup MODULE_BUFFER + * \brief Release streaming work buffer + * \param mvply A valid CriMvPly handle + * + * This function releases streaming work buffers allocated from the CriHeap + * previously associated with criMvPly_AllocateWorkBuffer(). + * This function should only be called at CRIMVPLY_STATUS_STOP, + * CRIMVPLY_STATUS_WAIT_PREP or CRIMVPLY_STATUS_PLAYEND states. However, this + * function does not verify the current stream status before releasing + * all the buffers; it merely deallocates them. Expect interesting crashes + * if you call this function while playing a movie. + * + * You can verify the current CriMvPly handle status with criMvPly_GetStatus() if + * necessary. + * + */ +void CRIAPI criMvPly_FreeWorkBuffer(CriMvPly mvply); + +/* ĐI[fBI`l̐ݒ */ +/* + * \brief ĐI[fBI`l̐ݒ + * \param mvply : CRI Movie nh + * \param ch : I[fBI`lԍ + * \return Ȃ + * \par : + * CriMvStreamingParameters\̂̃o track_play_audiõftHglݒ肵܂B
+ * criMvPly_GetStreamingParameters֐CriMvStreamingParameters\̂擾Ƃɂ̒li[܂B
+ * ݒ肵ĂȂꍇAbuffering_timeɂ0܂B + * -1w肷ƃI[fBIĐȂݒɂȂ܂B + */ +void CRIAPI criMvPly_SetAudioTrack(CriMvPly mvply, CriSint32 track); + +/* obt@O(P[sec])̐ݒ */ +/* + * \brief obt@O(P[sec])̐ݒ + * \param mvply : CRI Movie nh + * \param time : obt@O + * \return Ȃ + * \par : + * CriMvStreamingParameters\̂̃obuffering_timẽftHglݒ肵܂B
+ * criMvPly_GetStreamingParameters֐ CriMvStreamingParameters\̂擾Ƃɂ̒li[܂B
+ * ݒ肵ĂȂꍇAbuffering_timeɂ1.0bĂ܂B + */ +/* + * \ingroup MODULE_BUFFER + * \brief Set default buffering time (unit[sec]) + * \param mvply A valid CriMvPly handle + * \param time Buffering time in seconds + * + * This function tells the CriMvPly handle how much time of the stream to buffer in + * memory. Buffering is necessary to cover seeks, error retries, latency and + * other various hiccups in most data sources. + * + * This value is stored in the buffering_time field of the CriMvStreamingParameters + * struct. It is set to a default of 1.0 seconds when the CriMvPly handle is created. + * This is typically safe for most DVD type file systems. + * + * \sa CriMvPly, CriMvStreamingParameters + */ +//void CRIAPI criMvPly_SetBufferingTime(CriMvPly mvply, CriFloat32 time); + +/* ǂݍ݃t@C̐ݒ */ +/* + * \brief ǂݍ݃t@C̐ݒ + * \param mvply : CRI Movie nh + * \param max_stm : ǂݍ݃t@C + * \return Ȃ + * \par : + * CriMvStreamingParameters\̂̃omax_simultaneous_read_files̃ftHglݒ肵܂B
+ * criMvPly_GetStreamingParameters֐ CriMvStreamingParameters\̂擾Ƃɂ̒li[܂B
+ * ݒ肵ĂȂꍇAmax_simultaneous_read_filesɂ1Ă܂B + */ +/* + * \ingroup MODULE_BUFFER + * \brief Set maximum number of simultaneous streams + * \param mvply A valid CriMvPly handle + * \param max_stm The maximum number of simultaneous streams + * + * This function sets the default value of the "max_simultaneous_read_files" field of + * the CriMvStreamingParameters struct. Currently, setting this value has no effect. + */ +//void CRIAPI criMvPly_SetMaxSimultaneousStreams(CriMvPly mvply, CriUint32 max_stm); + +/* TEho̓obt@Tv̐ݒ */ +/* + * \brief GetWave16ŗvőTv̐ݒ + * \param mvply : CRI Movie nh + * \param max_smpl : őTv + * \return Ȃ + * \par : + * CriMvAudioParameters\̂̃ooutput_buffer_samples̃ftHglݒ肵܂B
+ * criMvPly_GetStreamingParameters֐ CriMvStreamingParameters\̂擾Ƃɂ̒li[܂B
+ * ݒ肵ĂȂꍇAoutput_buffer_samplesɂ16*1024Ă܂B + */ +/* + * \ingroup MODULE_AUDIO + * \brief Set default sound output buffer samples + * \param mvply A valid CriMvPly handle + * \param smpls : sound output buffer samples + * + * This function sets the default value of the "output_buffer_samples" field in the + * CriMvAudioParameters struct. The default value is 16384, which is set when + * criMvPly_Create() is called. + * + * This function only has an effect if it is called before the + * criMvPly_AllocateWorkBuffer() function is called, since this is when the audio + * output buffer is allocated. + * + * \sa CriMvAudioParameters, criMvPly_Create(), criMvPly_AllocateWorkBuffer(), + * criMvPly_GetWave16() + */ +//void criMvPly_SetMaxSamplesOfGetWave16(CriMvPly mvply, CriUint32 max_smpl); +void CRIAPI criMvPly_SetSoundOutputBufferSamples(CriMvPly mvply, CriUint32 smpls); + +/* nhԂ̎擾 */ +/* + * \brief nhԂ̎擾 + * \param mvply : CRI Movie nh + * \return nh + * \par : + * nhԂ擾܂B + */ +/* + * \ingroup MODULE_STATE + * \brief Get the handle status + * \param mvply A valid CriMvPly handle + * \return One of the CriMvPlyStatus enum values + * + * This function gets the current status of the CRI Movie handle. Check the + * following link for possible return values. + * + * \sa CriMvPlyStatus + */ +CriMvPlyStatus CRIAPI criMvPly_GetStatus(CriMvPly mvply); + +/* WAITԂ玟̏Ԃւ̑Jڒʒm */ +/* + * \brief WAITԂ玟̏Ԃւ̑Jڒʒm + * \param mvply : CRI Movie nh + * \return Ȃ + * \par : + * nhԂWAIT_**** Ԃ玟̏ԂɑJڂ܂BԂɉĎ̂悤Ɏgp܂B
+ * EWAIT_PREP : criMvPly_AllocateWorkBuffer֐Ń[NmۂĂяoĂB
+ * EWAIT_PLAYING : rfIt[AI[fBIf[^擾ĕ\Eo͂̏łA + * o͂JnāA{֐ĂяoĂB
+ * EWAIT_PLAYEND : Ō̃rfIt[̕\AŌ̃I[fBIf[^̏o͂IĂяoĂB
+ * EWAIT_STOP : rfII[fBȈo͂~ĂԂɂȂAĂяoĂB
+ * {֐ĂяoƊeԂ͑Ɏ̏ԂɑJڂ܂B
+ * {֐ WAIT_**** ȊȌԂŌĂяoĂAԂ͉ς܂B + */ +/* + * \ingroup MODULE_STATE + * \brief Notify transition from WAIT status + * \param mvply A valid CriMvPly handle + * + * This function notifies the CriMvPly handle that your application is ready to + * go from the current WAIT state to the next state. There are exactly four states + * in which it is appropriate to call this function: + * + * - CRIMVPLY_STATUS_WAIT_PREP After your application has allocated buffers with + * criMvPly_AllocateWorkBuffer() + * - CRIMVPLY_STATUS_WAIT_PLAYING After your application has prerolled stream data (if + * necessary) + * - CRIMVPLY_STATUS_WAIT_PLAYEND After your application has displayed the last frames of audio and + * video from the stream + * - CRIMVPLY_STATUS_WAIT_STOP After your application suspends playback from the stream + * + * You can check the current status of the CriMvPly handle by calling the criMvPly_GetStatus() + * function. This function has no effect if called in states other than those listed above. + * + * \sa CriMvPly, CriMvPlyStatus + */ +void CRIAPI criMvPly_IncrementState(CriMvPly mvply); + +/* Ԃ̍XV */ +/* + * \brief CriMvPlyW[̃T[o֐ + * \param mvply : CRI Movie nh + * \return Ȃ + * \par : + * Ƀf}`vNT̃f[^̍XVs܂B
+ * {֐̓AvP[ṼCXbhłŖĂяo悤ɂĂB
+ */ +void CRIAPI criMvPly_Update(CriMvPly mvply); + +/* ĐJn */ +/* + * \brief ĐJn + * \param mvply : CRI Movie nh + * \return ĐJnłꍇCRI_TRUE, sꍇCRI_FALSE + * \par : + * Đ̂߂̏Jn܂B
+ * {֐ďoAnhԂDECHDRɑJڂ܂B
+ */ +/* + * \ingroup MODULE_STATE + * \brief Start of playback processing + * \param mvply A valid CriMvPly handle + * + * This function initiates playback processing. This function should be called + * after the CriMvPly handle is created and the data source has been opened, + * but before the work buffers are allocated with criMvPly_AllocateWorkBuffer(). + * This function sets the current status of the CriMvPly handle to + * CRIMVPLY_STATUS_DECHDR, which prepares it to decode the header information + * from the data source. + * + * \sa CriMvPly, CriMvPlyStatus, criMvPly_AllocateWorkBuffer() + */ +CriBool CRIAPI criMvPly_Start(CriMvPly mvply); + +/* Đ~NGXg(A) */ +/* + * \brief Đ~NGXg(A) + * \param mvply : CRI Movie nh + * \return Ȃ + * \par : + * Đ~̃NGXg𔭍sđA܂B
+ * {֐ďoAnhԂSTOP_PROCESSINGԂɑJڂ܂B
+ * ~̂߂̏IƁAnhԂWAIT_STOPɑJڂ܂B
+ * WAIT_STOPԂɂȂAcriMvPly_IncrementState֐STOPԂɑJڂāA + * AvP[V̒~sĂB + */ +/* + * \ingroup MODULE_STATE + * \brief Non-blocking request to stop playback + * \param mvply A currently playing CriMvPly handle + * + * This function records a request to terminate playback. Termination of + * playback is not synchronous to this function; this function sets the current + * state of the CriMvPly handle to CRIMVPLY_STATUS_STOP_PROCESSING. After + * movie processing is halted, the state of the handle transitions to + * CRIMWPLY_STATUS_WAIT_STOP. + * + * This function is useful for prematurely terminating a movie, e.g. "press + * X to skip this movie". + * + * Video frames will keep being delivered until you detect a CRIMVPLY_STATUS_WAIT_STOP + * state in the CriMvPly handle, and then call criMvPly_IncrementState to transition + * back to the CRIMVPLY_STATUS_STOP state. + * + * \note Pausing is not accomplished through this function. The system clock, including + * whether or not to pause or advance frames, is controlled entirely through user + * code. So the effect of "pausing" a CriMvPly handle can be accomplished by simply + * not updating your system clock as long as your pause is in effect. + * + * \sa CriMvPly, CriMvPlyStatus + */ +void CRIAPI criMvPly_Stop(CriMvPly mvply); + +/* T[o(nhw) */ +/* + * \brief T[o(nhw) + * \param mvply : CRI Movie nh + * \return Ȃ + * \par : + * CRI Movie nhw肵ăT[os܂B
+ * eWAIT_**** Ԃւ̏ԑJڂ̓T[o֐Ŏs܂B + */ +/* + * \ingroup MODULE_VIDEO + * \brief Execute heartbeat functions for a handle + * \param mvply A valid CriMvPly handle + * + * This function executes heartbeat functions for the specified CriMvPly handle only, + * including handoff and parsing of input buffers and audio decoding. Additionally, + * it checks for buffer situations in which the CriMvPly handle should transition to + * one of the four WAIT states of CriMvPlyStatus, and it makes these transitions if + * necessary. + * + * However, video decoding does NOT occur in criMvPly_Execute(). + * + * Expect that criMvPly_Execute() will take a relatively low CPU load. Typically, + * this function should be called on every vertical blank. However, it may be called + * more frequently in a CriMvPly wait state, in conjunction with criMvPly_IncrementState(), + * in order to "force" a transition into the next state without waiting for + * another vertical blank. This type of transition is not generically + * necessary. + * + * \sa CriMvPly, CriMvPlyStatus, criMvPly_ExecuteAll() + */ +void CRIAPI criMvPly_Execute(CriMvPly mvply); + +/* t@Cǂݍ݃obt@̋󂫃`N擾 */ +/* + * \brief t@Cǂݍ݃obt@̋󂫃`N擾 + * \param mvply : CRI Movie nh + * \param ck : `N + * \return Ȃ + * \par : + * t@Cǂݍ݃obt@̋󂫗̈擾܂B
+ * 擾󂫗̈i`NƌĂт܂j́Af[^݂ʒm邳 + * ̂܂܎gp܂̂ŁAAvP[VŋLĂB
+ * PxɎ擾ł`N͂P‚݂̂łB
+ * `N擾łۂ́A`ÑTCYŔł܂B
+ * f[^݂̏IAcriMvPly_PutInputChunk֐ŏ݃TCYʒmĂB
+ */ +/* + * \ingroup MODULE_SUPPLY + * \brief Get a free chunk from file reading buffer + * \param mvply A valid CriMvPly handle + * \param ck A CriChunk structure to be filled with data by this function + * + * This function selects an empty internal buffer for your data source to read its data into. + * An area of this type is referred to as a "chunk." + * After calling this function, the ck->data and ck->size + * fields will provide a valid pointer and size, respectively, that your data + * source should copy its data into. + * If no buffers can internally be allocated, this function will return 0 as the + * ck->size field. If this occurs, your program should choke input until a free + * buffer can be allocated. + * Typical data sources are native file reading, sequential memory access, or + * playback from a network source. + * The ck->size field is dynamically calculated when criMvPly_AllocateWorkBuffer() + * is called; it is calculated based on expected data rate and video resolutions + * embedded in the stream file. + * + * After you receive a valid chunk from criMvPly_GetInputChunk(), + * you can fill the provided chunk up to the ck->size limit. After you + * fill the chunk with valid data, call the criMvPly_PutInputChunk() function + * to queue the data for processing. The functions criMvPly_GetInputChunk() and + * criMvPly_PutInputChunk() should be called in equal pairs; calling these + * functions out of order will produce odd results. No dynamic chunk reordering + * is permitted; serial calls with out-of-order chunks will be + * flagged at run-time as an error. + * + * This function will only return a valid chunk if the CriMvPly handle is in + * one of two playback states: CRIMVPLY_STATUS_PLAY or CRIMVPLY_STATUS_DECHDR. + * You can verify the current playback state with criMvPly_GetStatus(). + * + * \sa criMvPly_GetStatus(), criMvPly_PutInputChunk(), criMvPly_AllocateWorkBuffer(), + * CriChunk, CriMvPlyStatus + */ +void CRIAPI criMvPly_GetInputChunk(CriMvPly mvply, CriChunk *ck); + +/* t@Cǂݍ݃obt@ւ̃f[^ݒʒm */ +/* + * \brief t@Cǂݍ݃obt@ւ̃f[^ݒʒm + * \param mvply : CRI Movie nh + * \param ck : + * \param inputsize : + * \return Ȃ + * \par : + * criMvPly_GetInputChunk֐Ŏ擾󂫗̈i`NƌĂт܂j + * f[^ݏIAinputsizeɃf[^TCYĖ{֐ĂяoĂB
+ * ̍ہA`N criMvPly_GetInputChunk֐Ŏ擾̂Ɠ`NKw肵ĂB + */ +/* + * \ingroup MODULE_SUPPLY + * \brief Put a data chunk into file read buffer + * \param mvply A valid CriMvPly handle + * \param ck A CriChunk structure containing source data + * \param inputsize The number of bytes actually supplied + * + * This function informs the CriMvPly handle that the CriChunk structure + * now contains valid data from the data source. Typically, you would call + * this function after your asynchronous file read reports that the buffer is + * full of data. + * + * The inputsize field should contain the number of bytes actually provided. + * This value can be less than or equal to ck->size. In an end-of-file condition, + * be sure to supply the actual number of bytes remaining in the file, and not + * merely the size of the input buffer, to criMvPly_PutInputChunk(). + * Do not modify the contents of the CriChunk after calling this function; + * instead, call criMvPly_GetInputChunk() to get a new chunk for further input. + * + * This function invalidates the CriChunk provided if the function is called + * while the CriMvPly handle is in the CRIMVPLY_STATUS_STOP, the + * CRIMVPLY_STATUS_WAIT_PREP, or the CRIMVPLY_STATUS_STOP_PROCESSING state. + * You can verify the current playback state with criMvPly_GetStatus(). + * + * After you receive a valid chunk from criMvPly_GetInputChunk(), + * you can fill the provided chunk up to the ck->size limit. After you call + * fill the chunk with valid data, call the criMvPly_PutInputChunk() function + * to queue the data for processing. The function criMvPly_GetInputChunk() and + * criMvPly_PutInputChunk() should be called in equal pairs; calling these + * functions out of order will produce odd results. No dynamic chunk reordering + * is permitted; serial calls with out-of-order chunks will be + * flagged at run-time as an error. + * + * After putting the final chunk of data in the stream, call + * criMvPly_TerminateSupply() to indicate that an end-of-file condition exists. + * + * \sa criMvPly_GetStatus(), criMvPly_GetInputChunk(), criMvPly_AllocateWorkBuffer(), + * criMvPly_TerminateSupply(), CriChunk, CriMvPlyStatus + */ +void CRIAPI criMvPly_PutInputChunk(CriMvPly mvply, CriChunk *ck, CriUint32 inputsize); + +/* t@CǂݍݏI̒ʒm */ +/* + * \brief t@CǂݍݏI̒ʒm + * \param mvply : CRI Movie nh + * \return Ȃ + * \par : + * ĐSẴf[^ǂݍŁA criMvPly_PutInputChunk֐ŒʒmIA + * {֐Ńt@CǂݍݏI̒ʒmKsĂB
+ * Iʒmꂽ_œǂݍ݃obt@ɏ܂ꂽSẴf[^fR[hIƁA + * nhԂWAIT_PLAYENDɑJڂ܂B
+ * {֐ĂяoȂAWAIT_PLAYENDԂɂȂ邱Ƃ͂܂B + */ +/* + * \ingroup MODULE_SUPPLY + * \brief Notify end of reading data + * \param mvply A valid CriMvPly structure + * + * After you put all the source data into the CriMvPly handle with + * criMvPly_PutInputChunk(), indicate the end of the movie file by calling + * criMvPly_TerminateSupply(). After calling this function, the CriMvPly + * handle's status is changed by the library to CRIMVPLY_STATUS_WAIT_PLAYEND + * and the library completes processing of whatever frames it has internally + * buffered. + * + * If you do not call this function, the CriMvPly handle will never transition + * to the CRIMVPLY_STATUS_WAIT_PLAYEND state, making teardown impossible. + * + * \sa criMvPly_PutInputChunk(), CriMvPly, CriMvPlyStatus + */ +void CRIAPI criMvPly_TerminateSupply(CriMvPly mvply); + +#if 0//defined(XPT_TGT_EE) +/* RGB32tH[}bg̃rfIt[̎擾 */ +/* + * \if ps2 + * \brief RGB32tH[}bg̃rfIt[̎擾 + * \param mvply : CRI Movie nh + * \param imagebuf : rfIt[obt@ + * \param bufsize : obt@TCY + * \param frameinfo : t[ + * \return 擾łꍇTRUE, łȂꍇFALSE + * \par : + * Ŏw肵obt@ɁAPS2̃}NubNRGBA32tH[}bgŃt[擾܂B
+ * CriMvFrameInfo\̂ɂ́A擾t[ɂ‚Ă̏񂪊i[܂B
+ * t[擾ł̂́AnhԂWAIT_PLAYING^PLAYING݂̎̂łB
+ * ȊȌԂŌĂяoA܂͓̓f[^s̏ꍇɂ́A{֐̓t[̎擾ɎsAɕA܂B
+ * t[擾łȂꍇ́A֐lFALSEԂ܂B
+ * ۂ̃rfIfR[h{֐œ߁At[擾łꍇɂ́Ȁd֐ƂȂ܂B + * \endif + */ +/* + * \if ps2 + * \ingroup MODULE_VIDEO + * \brief Get a video frame in PS2 macroblock RGB32 format + * \param mvply A valid CriMvPly handle + * \param imagebuf a pointer to the video buffer in memory to receive the frame + * \param bufsize video buffer size in bytes + * \param frameinfo Information about the decoded frame + * \return returns true if a frame has been copied into the buffer, false otherwise + * + * This function finds and decodes the current frame, if any, to the imagebuf buffer. + * The format of this buffer is specific to the PS2. This function will only return + * a valid frame if the CriMvPly handle is in the CRIMVPLY_STATUS_WAIT_PLAYING or the + * CRIMVPLY_STATUS_PLAYING state. + * + * This function is an EE-intensive activity, and the amount of time required + * is variable, depending on the complexity and size of the video frame being decoded. + * Therefore the preferred method of calling this function is in a low priority thread, + * separate from your I/O, buffer management, and criMvPly_Execute() routines. + * + * If this function returns true, the preferred display time of the video frame is calculated + * as: + * + * \code + * frameinfo.time / frameinfo.tunit + * \endcode + * + * Humans notice audio stuttering much more readily than a dropped video frame during + * a video decode process. If the frame reported by criMvPly_GetFrameRGBA32_PS2() + * arrives after your system clock says the frame should be displayed, you should + * simply drop the frame without bothering to DMA it to video memory. + * + * Here is an example showing how to drop frames in this case: + * + * \dontinclude crimvt01_simple_playback_ps2.c + * \skip Get video frame + * \until *tutor_update_video_frame_on_display_time* + * + * It is not preferred, but it is possible, to call this function in a single-threaded + * playback model. In this case, it is important to allocate more heap space + * and service the CriMvPly handle with criMvPly_Execute() or criMvPly_ExecuteAll() + * frequently, as well as criMvPly_GetWave16() frequently. This helps to cover + * for the case where other I/O needs to occur when a frame is currently being decoded by + * criMvPly_GetFrameRGBA32_PS2(). + * + * \image html crimvply_getframergba32_ps2.png The DMA reordering step on PS2 + * + * In order to get acceptable performance on the PS2, a macroblock reordering step + * must take place during the DMA transfer from EE RAM to video RAM. + * \endif + */ +CriBool CRIAPI criMvPly_GetFrameRGBA32_PS2(CriMvPly mvply, CriUint8 *imagebuf, CriUint32 bufsize, CriMvFrameInfo *frameinfo); + +CriBool CRIAPI criMvPly_DecodeFrameRGBA32_PS2(CriMvPly mvply, CriUint8 *imagebuf, CriUint32 bufsize, CriMvFrameInfo *frameinfo); +#endif + +#if defined(XPT_TGT_PC) || defined(XPT_TGT_XBOX360) || defined(XPT_TGT_WII) || defined(XPT_TGT_SH7269) || defined(XPT_TGT_TRGP6K) +/* + * \if pc + * \ingroup MODULE_VIDEO + * \brief Get a video frame in YUV422 format + * \param mvply A valid CriMvPly handle + * \param imagebuf A pointer to the video buffer in memory to receive the frame + * \param pitch Number of bytes in one row of the video buffer + * \param bufsize Video buffer size in bytes + * \param frameinfo Information about the decoded frame + * \return returns true if a frame has been copied into the buffer, false otherwise + * + * This function finds and decodes the current frame, if any, to the imagebuf buffer. + * This function will only return a valid frame if the CriMvPly handle is in the + * CRIMVPLY_STATUS_WAIT_PLAYING or the CRIMVPLY_STATUS_PLAYING state. + * + * This function is a CPU-intensive activity, and the amount of time required + * is variable, depending on the complexity and size of the video frame being decoded. + * Therefore the preferred method of calling this function is in a low priority thread, + * separate from your I/O, buffer management, and criMvPly_Execute() routines. + * + * If this function returns true, the preferred display time of the video frame is calculated + * as: + * + * \code + * frameinfo.time / frameinfo.tunit + * \endcode + * + * It is not preferred, but it is possible, to call this function in a single-threaded + * playback model. In this case, it is important to allocate more heap space + * and service the CriMvPly handle with criMvPly_Execute() or criMvPly_ExecuteAll() + * frequently, as well as criMvPly_GetWave16() frequently. + * + * \endif + */ +CriBool CRIAPI criMvPly_GetFrameYUV422(CriMvPly mvply, CriUint8 *imagebuf, CriUint32 pitch, CriUint32 bufsize, CriMvFrameInfo *frameinfo); +#endif + +/* 16bit WAVEtH[}bg̃I[fBIf[^擾 */ +/* + * \brief 16bit WAVEtH[}bg̃I[fBIf[^擾 + * \param mvply : CRI Movie nh + * \param nch : `l + * \param waveptr : I[fBIf[^obt@ + * \param wavesmpl : vTv(obt@TCY) + * \param waveinfo : 16bit Waveform + * \return 擾łTv + * \par : + * 16bitWAVEtH[}bgŃI[fBIf[^擾܂Bwaveptrɂ́Anch̃obt@|C^i[ + * zw肵ĂB
+ * CriMvWaveInfo\̂ɂ́A擾I[fBIf[^ɂ‚Ă̏񂪊i[܂B
+ * ̓f[^sȂǂŗvꂽTṽfR[hłȂꍇ܂B
+ * (@\) {֐̏dȂĂłAȂׂvꂽ̃I[fBIf[^擾郂[hB + */ +/* + * \ingroup MODULE_AUDIO + * \brief Get 16bit wave audio data + * \param mvply A currently playing CriMvPly handle + * \param nch The number of audio channels to get in this call + * \param waveptr An array of audio data buffers to copy audio data into + * \param wavesmpl The number of requested wave data samples (must be less than buffer size) + * \param waveinfo A structure filled by this function with info about this wave + * \return The number of wave data samples actually copied into the buffer + * + * This function copies currently decoding audio data into your output buffer + * for you to send to the audio output. The output format is a sixteen-bit PCM + * format. The data provided is "current", e.g. you should try to minimize latency. + * while delivering the audio data to the output device. + * + * This function will return an empty audio buffer if the input to the CriMvPly + * handle is starving for data, or if criMvPly_Execute() or criMvPly_ExecuteAll() + * has not been called recently. + * + * Note that this function actually copies data. However, the expected bandwidth + * for moving audio data in memory is minimal -- about 176400 bytes per second for + * a stereo stream, which is typically a fraction of 1% of the bandwidth available + * on modern game systems. + * + * For debugging tips on stuttering, see \ref crim_section_stuttering . + */ +CriUint32 CRIAPI criMvPly_GetWave16(CriMvPly mvply, CriUint32 nch, CriSint16 *waveptr[], + CriUint32 wavesmpl, CriMvWaveInfo *waveinfo); +CriUint32 CRIAPI criMvPly_GetWave32(CriMvPly mvply, CriUint32 nch, CriFloat32 *waveptr[], + CriUint32 wavesmpl, CriMvWaveInfo *waveinfo); + + +#if defined(XPT_TGT_EE) +/* XNb`pbhRAMgpݒ */ +/* XNb`pbhRAM̎gpݒ(nh쐬OɌĂяo) */ +/* + * \brief XNb`pbhRAMgpݒ + * \param sw : + * \return Ȃ + * \par : + * XNb`pbhRAM̎gpݒs܂B
+ * ftHgOFFłB + */ +/* + * \if ps2 + * \ingroup MODULE_INIT + * \brief Enable or disable PS2 scratch pad (SPRAM) usage + * \param sw : ON to enable scratch pad use, OFF to disable + * + * This function determines whether the video decode step uses the PS2 + * SPRAM memory area for its work. The performance of this library is + * increased by around 30% when using SPRAM; however, this use might + * conflict with graphics engines that depend on exclusive access to SPRAM. + * However, on the PS2, the video decode step occurs synchronously to the + * criMvPly_GetFrameRGBA32_PS2() function, so you can take appropriate external + * locking measures to intelligently synchronize SPRAM utilization. + * The value set by criMvPly_SetUseScratchPadRAM_PS2() is internally checked + * exactly once, during the criMvPly_Create() step; calling this function + * after criMvPly_Create() has no effect. The default setting for this + * function is OFF. + * \endif + */ +void CRIAPI criMvPly_SetUseScratchPadRAM_PS2(CriBool sw); +#endif + + +/* ̍ĐJn */ +/* + * \brief ̍ĐJn + * \param mvply : CRI Movie nh + * \param memptr : ̃[rf[^̐擪AhX + * \param memsize : ̃[rf[^̃TCY + * \return Ȃ + * \par : + * ̃[rĐJn܂B
+ * {֐̌ĂяoOɁA炩߃[rf[^̑SĂɓǂݍłĂB + */ +/* + * \ingroup MODULE_STATE + * \brief Start playback from movie file on memory + * \param mvply A currently playing CriMvPly handle + * \param memptr A address of movie file + * \param memsize The size of movie file + * + * Start playback from memory.
+ * Please read movie file to memory before playback. + */ +void CRIAPI criMvPly_StartMemory(CriMvPly mvply, CriUint8* memptr, CriUint32 memsize); + + +/* + * YUV•ʃobt@ւ̃t[擾 + */ +/* + * \if xbox360 + * \ingroup MODULE_VIDEO + * \brief Get a video frame to Y,U,V independently texture buffers + * \param mvply A valid CriMvPly handle + * \param yuvbuffers Information about Y,U,V independently texture buffers + * \param frameinfo Information about the decoded frame + * \return returns true if a frame has been copied into the buffer, false otherwise + * + * This function finds and decodes the current frame, if any, to the Y,U,V texture buffers. + * This function will only return a valid frame if the CriMvPly handle is in the + * CRIMVPLY_STATUS_WAIT_PLAYING or the CRIMVPLY_STATUS_PLAYING state. + * \endif + */ +CriBool CRIAPI criMvPly_GetFrameYUVBuffers(CriMvPly mvply, CriMvYuvBuffers *yuvbuffers, CriMvFrameInfo *frameinfo); + + +/* + * rfĨfR[h + */ +/* + * \ingroup MODULE_VIDEO + * \param mvply The movie player handle + * \return returns the number of decoded frames + * + */ +CriUint32 CRIAPI criMvPly_DecodeVideo(CriMvPly mvply); + +/* + * wb_̃fR[h + */ +/* + * + * \ingroup MODULE_VIDEO + * \param mvply The movie player handle + * + */ +void CRIAPI criMvPly_DecodeHeader(CriMvPly mvply); + +/* + * fR[hXLbvw + * \par : + * ̊֐s񐔂Ǎ̃fR[hɎIɂPBsN`XLbvB
+ * XLbvwõt[́Aۂ̃XLbvsĂȂĂ + * \̓XLbv̂Ƃĕ␳B + */ +/* + * \ingroup MODULE_VIDEO + * \param mvply The movie player handle + * \return returns the number of decoded frames + * + * After calling SkipFrame function, Decoding function skip B-picture. + * To avoid that application judge continuous wrong skip, After calling + * SkipFrame function, next frame time will be adjusted. + */ +void CRIAPI criMvPly_SkipFrame(CriMvPly mvply); + + +#if 0 +/* + * YUVA8tH[}bg̃t[擾 + */ +/* + * \if ps3 + * \ingroup MODULE_VIDEO + * \brief Get a video frame in YUVA8 format. + * \param mvply A valid CriMvPly handle + * \param imagebuf A pointer to the video buffer in memory to receive the frame + * \param pitch Number of bytes in one row of the video buffer + * \param bufsize Video buffer size in bytes + * \param frameinfo Information about the decoded frame + * \return returns true if a frame has been copied into the buffer, false otherwise + * + * This function finds and decodes the current frame, if any, to the imagebuf buffer. + * This function will only return a valid frame if the CriMvPly handle is in the + * CRIMVPLY_STATUS_WAIT_PLAYING or the CRIMVPLY_STATUS_PLAYING state. + * \endif + */ +CriBool CRIAPI criMvPly_GetFrameYUVA8_PS3(CriMvPly mvply, CriUint8 *imagebuf, CriUint32 pitch, CriUint32 bufsize, CriMvFrameInfo *frameinfo); +#endif + +/* + * ARGB8888tH[}bgŃt[擾 + */ +/* + * \if ps3 + * \ingroup MODULE_VIDEO + * \brief Get a video frame in ARGB8888 format. + * \param mvply A valid CriMvPly handle + * \param imagebuf A pointer to the video buffer in memory to receive the frame + * \param pitch Number of bytes in one row of the video buffer + * \param bufsize Video buffer size in bytes + * \param frameinfo Information about the decoded frame + * \return returns true if a frame has been copied into the buffer, false otherwise + * + * This function finds and decodes the current frame, if any, to the imagebuf buffer. + * This function will only return a valid frame if the CriMvPly handle is in the + * CRIMVPLY_STATUS_WAIT_PLAYING or the CRIMVPLY_STATUS_PLAYING state. + * \endif + */ +CriBool CRIAPI criMvPly_GetFrameARGB8888(CriMvPly mvply, CriUint8 *imagebuf, CriUint32 pitch, CriUint32 bufsize, CriMvFrameInfo *frameinfo); +void CRIAPI criMvPly_InitializeFrameARGB8888(void); + + +#if defined(XPT_TGT_IPHONE) || defined(XPT_TGT_WINMO) || defined(XPT_TGT_ANDROID) || defined(XPT_TGT_CQSH2A) || defined(XPT_TGT_ACRODEA) || defined(XPT_TGT_NACL) || defined(XPT_TGT_SH7269) || defined(XPT_TGT_TRGP6K) +/* + * RGB565tH[}bgŃt[擾 + */ +/* + * \ingroup MODULE_VIDEO + * \brief Get a video frame in RGB565 format + */ +CriBool CRIAPI criMvPly_GetFrameRGB565(CriMvPly mvply, CriUint8 *imagebuf, CriUint32 pitch, CriUint32 bufsize, CriMvFrameInfo *frameinfo); +void CRIAPI criMvPly_InitializeFrameRGB565(void); +#endif + +/* + * ̃t[̏񂾂擾 + */ +/* + * \ingroup MODULE_VIDEO + * \brief Get a information of next video frame (without actual video frame). + */ +CriUint8* CRIAPI criMvPly_GetNextFrameInfo(CriMvPly mvply, CriMvFrameInfo *frameinfo); + +/* + * ̃t[̂Ă + */ +CriBool CRIAPI criMvPly_DiscardNextFrame(CriMvPly mvply, CriMvFrameInfo *frameinfo); + +/* + * Đ(PREPWAIT_PLAYING)ɂȂ܂łɒt[̎w + * ̊֐ĂяoȂ΁At[ = t[v[ + */ +void CRIAPI criMvPly_SetNumberOfFramesForPrep(CriMvPly mvply, CriSint32 nframes); + +/* + * For Debug use. + */ +void CRIAPI criMvPly_SetSeekPosition(CriMvPly mvply, CriSint32 seek_frame_id, CriSint32 video_gop_top_id); +void CRIAPI criMvPly_SetSeekAlphaPosition(CriMvPly mvply, CriSint32 alpha_gop_top_id); +void CRIAPI criMvPly_CalcSeekPosition(CriMvPly mvply, void *seektbl_ptr, CriUint32 seektbl_size, Sint32 frame_id, Uint64 *offset, Sint32 *gop_top_id); + +/* for specific use */ +/* {fBAhX̐ݒ */ +void CRIAPI criMvPly_SetBodyData(CriMvPly mvply, const CriUint64Adr body_ptr, CriSint64 body_size); + +/* SJуobt@TCY̎擾iobt@TCYA[hTCYNULLwŏȗj */ +CriSj CRIAPI criMvPly_GetInputSj(CriMvPly mvply, CriUint32 *buffer_size, CriUint32 *reload_threshold); + +/* O^CvwɂCxg|Cg̎擾 */ +//Bool criMvPly_SearchEventPointByName(CriMvPly mvply, Char8 *cue_name, Sint32 type, CriMvEventPoint *eventinfo); +/* Cxg|Cg񂩂t[IDւ̕ϊ */ +//Sint32 criMvPly_CalcFrameIdFromCuePoint(CriMvPly mvply, CriMvEventPoint *eventinfo); + +CriBool CRIAPI criMvPly_AttachSubAudio(CriMvPly mvply, CriHeap heap, CriUint32 track); +CriUint32 CRIAPI criMvPly_GetSubAudioWave16(CriMvPly mvply, CriUint32 nch, CriSint16 *waveptr[], CriUint32 wavesmpl, CriMvWaveInfo *waveinfo); +CriUint32 CRIAPI criMvPly_GetSubAudioWave32(CriMvPly mvply, CriUint32 nch, CriFloat32 *waveptr[], CriUint32 wavesmpl, CriMvWaveInfo *waveinfo); +void CRIAPI criMvPly_DetachSubAudio(CriMvPly mvply); + +void CRIAPI criMvPly_GetSubtitle(CriMvPly mvply, CriUint8 *bufptr, CriUint32 bufsize, CriMvSubtitleInfo *info); +void CRIAPI criMvPly_GetNextSubtitleInfo(CriMvPly mvply, CriMvSubtitleInfo *info); + +/* ̓obt@̃f[^ʂ[byte] */ +CriUint32 CRIAPI criMvPly_PeekInputBufferData(CriMvPly mvply); +/* ̃[rSJɒlj */ +void CRIAPI criMvPly_AddInputMemory(CriMvPly mvply, CriUint8* memptr, CriUint32 memsize); + + +/* 擾łI[fBIf[^̃Tv𒲂ׂ */ +CriUint32 CRIAPI criMvPly_GetDataSizeMainAudio(CriMvPly mvply, CriUint32 nch); +/* 擾łI[fBIf[^̃Tv𒲂ׂ */ +CriUint32 CRIAPI criMvPly_GetDataSizeSubAudio(CriMvPly mvply, CriUint32 nch); + +/* C̃I[fBI̍ĐIĂ邩ǂ𒲂ׂ */ +CriBool CRIAPI criMvPly_IsEndMainAudioPlayback(CriMvPly mvply); +/* TũI[fBI̍ĐIĂ邩ǂ𒲂ׂ */ +CriBool CRIAPI criMvPly_IsEndSubAudioPlayback(CriMvPly mvply); + +/* CI[fBIǂ𒲂ׂ (fR[ho̓obt@) */ +CriBool CRIAPI criMvPly_IsActiveMainAudioPlayback(CriMvPly mvply); + +/* [NmۑOɐݒύX邱 */ +void CRIAPI criMvPly_SetPcmFormat(CriMvPly mvply, CriMvPcmFormat pcmfmt); + +#if defined(XPT_TGT_PC) +/* [PC] }`vZbT̎w */ +//void CRIAPI criMvPly_SetProcessorParameters_PC(CriMvPly mvply, Sint32 thread_num, Uint32 *affinity_masks, Sint32 *priorities); +#endif + +#if defined(XPT_TGT_XBOX360) +/* [Xbox360] }`vZbT̎w */ +void CRIAPI criMvPly_SetProcessorParameters_XBOX360(CriMvPly mvply, Sint32 thread_num, CriUint32 processor_mask, CriSint32 *priorities); +#endif + +#if defined(XPT_TGT_PS3PPU) +/* [PS3] SPURS̎w */ +void CRIAPI criMvPly_SetupSpursParameters_PS3(const CriMvProcessorParameters_PS3 *processor_param); + /* [PS3] SPUXbhɂ}`vZbT̎w */ +void CRIAPI criMvPly_SetupSpuThreadParameters_PS3(const CriMvSpuThreadParameters_PS3 *spu_thread_param); +void CRIAPI criMvPly_SetGraphicEnv(CriMvGraphicEnv env); +CriMvGraphicEnv CRIAPI criMvPly_GetGraphicEnv(void); +#endif + +/* t[v[̎擾 */ +void CRIAPI criMvPly_GetFramePoolInfo(CriMvPly mvply, CriSint32 *num_input, CriUint32* num_data, CriUint32* num_ref, CriUint32* num_hold, CriUint32* num_free); + +/* Đł`l؂ւ */ +void CRIAPI criMvPly_SetSubtitleChannel(CriMvPly mvply, CriSint32 chno); + +/* |C^擾ăt[v[̃obt@bN */ +CriBool CRIAPI criMvPly_LockFrameBuffer(CriMvPly mvply, CriMvYuvBuffers *yuvbuffers, CriMvFrameInfo *frameinfo); +/* bNĂt[v[ */ +CriBool CRIAPI criMvPly_UnlockFrameBuffer(CriMvPly mvply, CriMvFrameInfo *frameinfo); + +/* + * For Sofdec2 + */ +CriMvPly CRIAPI criMvPly_CreateWithWork(void *work, CriSint32 size, CriMvHandleConfig *config); +CriSint32 CRIAPI criMvPly_CalcHandleWorkSize(CriMvHandleConfig *config); +CriSint32 CRIAPI criMvPly_CalcPlaybackWorkSize(CriMvPly mvply, CriMvStreamingParameters *stmprm); +CriBool CRIAPI criMvPly_AllocateWorkBufferWithWork(CriMvPly mvply, void *work ,Sint32 work_size, CriMvStreamingParameters *stmprm); +void CRIAPI criMvPly_SetMetaDataWorkAllocator(CriMvPly mvply, CriMvMetaDataWorkMallocFunc allocfunc, CriMvMetaDataWorkFreeFunc freefunc, void *usrobj, CriMvMetaFlag meta_flag); +CriSint32 criMvPly_CalcSubAudioWorkSize(CriMvPly mvply, const CriMvAudioParameters *aprm); +CriBool criMvPly_CopyFrameYUVBuffers(CriMvPly mvply, CriMvYuvBuffers *yuvbuffers, + const CriMvFrameInfo *frameinfo,const CriMvAlphaFrameInfo *alpha_frameinfo); +CriBool criMvPly_CopyFrameARGB8888Buffer(CriMvPly mvply, CriUint8 *dst_buf, CriUint32 dst_pitch, CriUint32 dst_bufsize, + const CriMvYuvBuffers *src_bufs, const CriMvFrameInfo *src_vinf, const CriMvAlphaFrameInfo *src_ainf); +#if defined(XPT_TGT_IPHONE) || defined(XPT_TGT_WINMO) || defined(XPT_TGT_ANDROID) || defined(XPT_TGT_CQSH2A) || defined(XPT_TGT_ACRODEA) || defined(XPT_TGT_NACL) || defined(XPT_TGT_SH7269) || defined(XPT_TGT_TRGP6K) || defined(XPT_TGT_TRGP6K) +CriBool criMvPly_CopyFrameRGB565Buffer(CriMvPly mvply, CriUint8 *dst_buf, CriUint32 dst_pitch, CriUint32 dst_bufsize, + const CriMvYuvBuffers *src_bufs, const CriMvFrameInfo *src_vinf, const CriMvAlphaFrameInfo *src_ainf); +#endif +CriBool criMvPly_LockAlphaFrameBuffer(CriMvPly mvply, CriMvYuvBuffers *yuvbuffers, CriMvAlphaFrameInfo *alpha_frameinfo); +CriBool criMvPly_UnlockAlphaFrameBuffer(CriMvPly mvply, CriMvAlphaFrameInfo *alpha_frameinfo); +CriSint32 criMvPly_GetNumPictureData(CriMvPly mvply); +const CriMvPlyHeaderInfo* criMvPly_GetCurrentStreamInfo(CriMvPly mvply); +/* for debug */ +CriBool CRIAPI criMvPly_GetAlphaFrame(CriMvPly mvply, CriUint8 *imagebuf, CriUint32 pitch, CriMvAlphaFrameInfo *alpha_frameinfo); + +/* OUTER_FRAMEPOOL_WORK */ +/* t[v[p[NvZBnhNULLwOKB */ +CriSint32 criMvPly_CalcFramepoolWorkSize(CriMvPly mvply, const CriMvStreamingParameters *stmprm); +/* t[v[p[Nݒ */ +void criMvPly_SetFramepoolWork(CriMvPly mvply, void *work, CriSint32 work_size); +/* t[v[p[NAP[^ݒ */ +void criMvPly_SetFramepoolWorkAllocator(CriMvPly mvply, CriMvFramepoolWorkMallocFunc allocfunc, CriMvFramepoolWorkFreeFunc freefunc, void *usrobj); + +/* V[NubN̎擾 */ +/* <> + * - seektbl_ptr : UTFAhX + * - seektbl_size : UTFTCY + * - num_seekblock : o͔z̗vf + * + * - blockinfo : V[NubNzւ̃|C^inum_seekblock̗̈mۂēnƁj + */ +void criMvPly_GetSeekBlockInfo(CriMvPly mvply, void *seektbl_ptr, CriUint32 seektbl_size, CriSint32 num_seekblock, CriMvSeekBlockInfo *blockinfo); + +/* t[[g̋w */ +void criMvPly_SetVideoFramerate(CriMvPly mvply, CriUint32 framerate_n, CriUint32 framerate_d); + +/* L̐ݒ */ +void criMvPly_SetSyncFlag(CriMvPly mvply, CriBool sync_flag); + +/* Д\̖₢킹 */ +CriBool criMvPly_IsPlayable(CriMvPly mvply, const CriMvStreamingParameters *stmprm); + + + +#ifdef __cplusplus +} +#endif + +#endif /* CRI_MOVIE_CORE_H_INCLUDED */ diff --git a/3rdParty/cri/XboxOne/include/cri_movie_xboxone.h b/3rdParty/cri/XboxOne/include/cri_movie_xboxone.h new file mode 100644 index 00000000..519d1c30 --- /dev/null +++ b/3rdParty/cri/XboxOne/include/cri_movie_xboxone.h @@ -0,0 +1,96 @@ +/**************************************************************************** + * + * CRI Middleware SDK + * + * Copyright (c) 2013 CRI Middleware Co., Ltd. + * + * Library : CRI Movie + * Module : Library User's Header + * File : cri_movie_xboxone.h + * Date : 2013-11-25 + * + ****************************************************************************/ +/*! + * \file cri_movie_xboxone.h + */ +#ifndef CRI_MOVIE_XBOXONE_H_INCLUDED /* Re-definition prevention */ +#define CRI_MOVIE_XBOXONE_H_INCLUDED + +/*************************************************************************** + * Include file + ***************************************************************************/ +#include +#include + +#include +#include + +/*************************************************************************** + * Variable Declaration + ***************************************************************************/ +namespace CriMv { + extern CriError ErrorContainer; +} + +/*************************************************************************** + * Prototype Functions + ***************************************************************************/ +namespace CriMv { + /*EN + * \ingroup MODULE_OPTION + * \brief Set processor parameters for decoding (Library Global) + * + * \param num_threads Number of additional threads for load distribution in decoding (Maximum 5 threads) + * \param affinity_mask Pointer to an array of thread affinity masks for each thread specified with num_threads. + * \param priorities Pointer to an array of thread priority for each thread specified with num_threads. + * \param err Optional error code + * + * This function sets the processor parameters for decoding as default setting of library global. + * Use it when you want to change processors or thread priority for decoding load distribution. + * + * If this function is called, it must be called before library initialization. + * + * On initialization, CRI Movie prepares 5 worker threads for distributed decoding.
+ * + * \a num_threads specifies how many worker threads CRI Movie should use.
+ * \a affinity_mask is an array of affinity masks for the worker threads. This array must have + * \a num_threads many elements. + * \a priorities is an array of thread priority for the worker threads. This array must have + * \a num_threads many elements. + * The format of \a affinity_mask and \a priorities is same as for the value passed to the OS standard API.
+ * + * If this function is not called, 5 distributed decoding threads will run in parallel by default. + * Also, processor assignment of the decoding threads is handled by the operating system, and their + * priority will be THREAD_PRIORITY_BELOW_NORMAL. + */ + /*JP + * \ingroup MODULE_OPTION + * \brief fR[hɎgljvZbTݒiCuŚj + * \param num_threads וUfR[hpɎgpljXbh̐ (őTj + * \param affinity_masks XbhAtBjeB}XN̔zւ̃|C^Bnum_threadsŎw肵XbhƂ̃}XNlB + * \param priorities ljXbh̗Dxzւ̃|C^B + * \param err G[iȗj + * + * fR[h𕪎Uď邽߂̃vZbTCuŜɎw肵܂B + * fR[hɍsvZbTXbhDxύXꍇɎgpĂB + * {֐̓CuOɌĂяoKv܂B + * + * CRI Movie͏̍ۂɂT‚̕UfR[hp̃[J[Xbhpӂ܂B + * num_threadsŁÂ̂‚̃XbhۂɎgp邩wł܂B + * AvP[V疾IɃvZbT蓖ĂsꍇAX̃Xbhɑ΂ + * AtBjeB}XNƃXbhDxݒ肵ĂB + * AtBjeB}XNƃXbhDx̒ĺAOSW֐̈ƓłB + * + * ̊֐Ă΂ȂꍇAT‚̃XbhŕfR[hs܂B + * fR[hXbh̃vZbT͊蓖Ă͑SOSCŁADxTHREAD_PRIORITY_BELOW_NORMALɂȂ܂B + */ + void SetUsableProcessors_XBOXONE( + CriSint32 num_threads, + const DWORD_PTR *affinity_masks, + const int *priorities, + CriError &err = CriMv::ErrorContainer); +} + + + +#endif /* CRI_MOVIE_XBOXONE_H_INCLUDED */ diff --git a/3rdParty/cri/XboxOne/include/cri_sj.h b/3rdParty/cri/XboxOne/include/cri_sj.h new file mode 100644 index 00000000..9b7047b4 --- /dev/null +++ b/3rdParty/cri/XboxOne/include/cri_sj.h @@ -0,0 +1,189 @@ +/**************************************************************************** + * + * CRI Middleware SDK + * + * Copyright (c) 2006-2010 CRI Middleware Co., Ltd. + * + ****************************************************************************/ + +#ifndef _CRI_SJ_H_INCLUDED +#define _CRI_SJ_H_INCLUDED +/**************************************************************************** + * * + * CRI Stream Joint "CriSj" Library * + * * + * 2005-06-21 written by M.Oshimi * + * * + ****************************************************************************/ + +/**************************************************************************** + * Include file * + ****************************************************************************/ +#include "cri_xpt.h" +#include "cri_heap.h" + +/**************************************************************************** + * MACRO CONSTANT * + ****************************************************************************/ + +/* Version number of CriSj */ +#define CRISJ_NAME_STRINGS "CRI Stream Joint" +#define CRISJ_VERSION_STRINGS "1.01.00" + +#define CRISJUNI_MAX_LINE (4) +#define CRICHUNK_MAX_SIZE (0xffffffff) + +/*********************************************************************** + * Process MACRO + ***********************************************************************/ + +/**************************************************************************** + * Data type declaration * + ****************************************************************************/ + +/* Xg[C */ +typedef enum { + CRISJ_LINE_FREE = (0), + CRISJ_LINE_DATA = (1), + CRISJ_LINE_HOLD = (2), + CRISJ_LINE_EXTRA = (3), + /* enum be 4bytes */ + CRISJ_LINE_ENUM_BE_SINT32 = 0x7FFFFFFF +} CriSjLine; + +/* `N */ +#ifndef TYPEDEF_CRICHUNK +#define TYPEDEF_CRICHUNK +typedef struct { + CriUint8 *data; /* f[^ */ + CriUint32 size; /* oCg */ +} CriChunk; +#endif + +/* CriSjnh */ +/* CriSj handle */ +typedef struct { + struct _crisj_function_table *vtbl; + const CriChar8 *name; +} CriSjObj, *CriSj; + +typedef struct _crisj_function_table { + /* nh̏ */ + void (*Destroy)(CriSj sj); + /* Zbg */ + void (*Reset)(CriSj sj); + /* `N̎擾 (FIFO̐擪擾) */ + void (*GetChunk)(CriSj sj, CriSjLine id, CriUint32 nbyte, CriChunk *ck); + /* `N߂@(FIFO̐擪ɑ}) */ + void (*UngetChunk)(CriSj sj, CriSjLine id, CriChunk *ck); + /* `N} (FIFO̍Ōɑ}) */ + void (*PutChunk)(CriSj sj, CriSjLine id, CriChunk *ck); + /* C擾ł鑍oCg̎擾 */ + CriUint32 (*GetTotalSize)(CriSj sj, CriSjLine id); +} CriSjVirtualFunctionTable; + +typedef enum { + CRISJ_UNIMODE_SEPARATE = (0), + CRISJ_UNIMODE_JOIN = (1), + /* enum be 4bytes */ + CRISJ_UNIMODE_ENUM_BE_SINT32 = 0x7FFFFFFF +} CriSjUniversalMode; + + +typedef struct CriSjRbfConfig { + CriBool use_cs; + CriUint32 buffer_size; + CriUint32 extra_size; + CriUint32 alignment; + const CriChar8 *buffer_name; +} CriSjRbfConfig; + +typedef struct CriSjMemConfig { + CriBool use_cs; + CriUint8 *data; + CriUint32 data_size; +} CriSjMemConfig; + +typedef struct CriSjUniConfig { + CriBool use_cs; + CriSjUniversalMode mode; + CriUint32 num_chunks; +} CriSjUniConfig; + +/**************************************************************************** + * Function Declaration * + ****************************************************************************/ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +/* Oobt@^SJ̍쐬 */ +CriSint32 CRIAPI criSjRbf_CalculateWorkSize(const CriSjRbfConfig* config); +CriSj CRIAPI criSjRbf_Create(const CriSjRbfConfig *config, void *work, CriSint32 work_size); +CriSj CRIAPI criSjRbf_CreateByHeap(const CriSjRbfConfig *config, CriHeap heap, CriHeapType heap_type); + +/* 풓^SJ̍쐬 */ +CriSint32 CRIAPI criSjMem_CalculateWorkSize(const CriSjMemConfig* config); +CriSj CRIAPI criSjMem_Create(const CriSjMemConfig *config, void *work, CriSint32 work_size); +CriSj CRIAPI criSjMem_CreateByHeap(const CriSjMemConfig *config, CriHeap heap, CriHeapType heap_type); + +/* jo[TSJ̍쐬 */ +CriSint32 CRIAPI criSjUni_CalculateWorkSize(const CriSjUniConfig* config); +CriSj CRIAPI criSjUni_Create(const CriSjUniConfig *config, void *work, CriSint32 work_size); +CriSj CRIAPI criSjUni_CreateByHeap(const CriSjUniConfig *config, CriHeap heap, CriHeapType heap_type); +/* `FCv[̎擾 */ +CriSint32 CRIAPI criSjUni_GetNumChainPool(CriSj sj); + +void CRIAPI criSj_Destroy(CriSj sj); +void CRIAPI criSj_Reset(CriSj sj); +void CRIAPI criSj_GetChunk(CriSj sj, CriSjLine line, CriUint32 nbyte, CriChunk *ck); +void CRIAPI criSj_UngetChunk(CriSj sj, CriSjLine line, CriChunk *ck); +void CRIAPI criSj_PutChunk(CriSj sj, CriSjLine line, CriChunk *ck); +CriUint32 CRIAPI criSj_GetTotalSize(CriSj sj, CriSjLine line); +void CRIAPI criSj_SplitChunk(CriChunk *ck, CriUint32 nbyte, CriChunk *ck1, CriChunk *ck2); + +/*** +* New APIs +***/ + +CriUint32 CRIAPI criSj_GetInputFreeSize(CriSj sj); +void CRIAPI criSj_GetInputChunk(CriSj sj, CriChunk *ck); +void CRIAPI criSj_PutInputChunk(CriSj sj, CriChunk *ck, CriUint32 input_size); +CriUint32 CRIAPI criSj_GetOutputDataSize(CriSj sj); +void CRIAPI criSj_GetOutputChunk(CriSj sj, CriChunk *ck); +void CRIAPI criSj_PutOutputChunk(CriSj sj, CriChunk *ck, CriUint32 output_size); + +CriUint32 CRIAPI criSj_PutOutputChunk2(CriSj sj, CriChunk *ck1, CriChunk *ck2, CriUint32 output_size); + + +/*** +* Old Interface (for compatibility) +***/ +typedef struct _CriSjConfig { + CriBool use_cs; + CriHeapType heap_type; +} CriSjConfig; + +CriSj CRIAPI criSj_CreateRingBuffer(CriHeap heap, CriUint32 bsize, CriUint32 xsize, CriUint32 align); +CriSj CRIAPI criSj_CreateNamedRingBuffer(CriHeap heap, CriUint32 bsize, CriUint32 xsize, CriUint32 align, const CriChar8 *bname); +CriSj CRIAPI criSj_CreateRingBufferWithConfig(CriHeap heap, CriUint32 bsize, CriUint32 xsize, CriUint32 align, const CriSjConfig *config); +CriSj CRIAPI criSj_CreateNamedRingBufferWithConfig(CriHeap heap, CriUint32 bsize, CriUint32 xsize, CriUint32 align, const CriChar8 *bname, const CriSjConfig *config); +CriSint32 CRIAPI criSjRbf_GetRequiredMemorySizeWithConfig(CriUint32 bsize, CriUint32 xsize, CriUint32 align, const CriSjConfig *config); + +CriSj CRIAPI criSj_CreateMemory(CriHeap heap, CriUint8 *data, CriUint32 dtsize, CriUint32 align); +CriSj CRIAPI criSj_CreateMemoryWithConfig(CriHeap heap, CriUint8 *data, CriUint32 dtsize, CriUint32 align, const CriSjConfig *config); +CriSint32 CRIAPI criSjMem_GetRequiredMemorySizeWithConfig(CriUint32 align, const CriSjConfig *config); + +CriSj CRIAPI criSj_CreateUniversal(CriHeap heap, CriSjUniversalMode mode, CriUint32 nchunk); +CriSj CRIAPI criSj_CreateUniversalWithConfig(CriHeap heap, CriSjUniversalMode mode, CriUint32 nchunk, const CriSjConfig *config); +CriSint32 CRIAPI criSjUni_GetRequiredMemorySizeWithConfig(CriSjUniversalMode mode, CriUint32 nchunk, const CriSjConfig *config); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + + +#endif + +/* end of file */ diff --git a/3rdParty/cri/XboxOne/include/cri_xpt.h b/3rdParty/cri/XboxOne/include/cri_xpt.h new file mode 100644 index 00000000..5dbf4f36 --- /dev/null +++ b/3rdParty/cri/XboxOne/include/cri_xpt.h @@ -0,0 +1,26 @@ +/**************************************************************************** + * + * CRI Middleware SDK + * + * Copyright (c) 2004-2009 CRI Middleware Co., Ltd. + * + * Library : CRI Middleware Library + * Module : CRI Common Header for XboxOne + * File : cri_xpt.h + * Date : 2013-03-04 + * Version : 1.16 + * + ****************************************************************************/ +#ifndef CRI_INCL_CRI_XPT_H +#define CRI_INCL_CRI_XPT_H + +#define XPT_TGT_XBOXONE +#define XPT_CCS_LEND +#define XPT_SUPPORT_MULTICHANNEL +#define CRI_TARGET_STR "XboxOne" + +#include "cri_xpts_xboxone.h" +#include "cri_xpt_post.h" + +#endif /* CRI_INCL_CRI_XPT_H */ +/* End Of File */ diff --git a/3rdParty/cri/XboxOne/include/cri_xpt_post.h b/3rdParty/cri/XboxOne/include/cri_xpt_post.h new file mode 100644 index 00000000..de333b7b --- /dev/null +++ b/3rdParty/cri/XboxOne/include/cri_xpt_post.h @@ -0,0 +1,256 @@ +/***************************************************************************** + * + * CRI Middleware SDK + * + * Copyright (c) 1998-2012 CRI Middleware Co., Ltd. + * + * Library : CRI Middleware Library + * Module : CRI Common Header / Post-Process + * File : cri_xpt_post.h + * Date : 2012-05-15 + * Version : 2.07 + * + *****************************************************************************/ +#ifndef CRI_INCL_CRI_XPT_POST_H +#define CRI_INCL_CRI_XPT_POST_H + + +/***************************************************************************** + * }N` + * Macro definition + *****************************************************************************/ + +/* RpC̐ÓIAT[g + * C++ BoostSTATIC_ASSERTƓ̋@\CŎB + * ^ł邱Ƃ؂BȔꍇ̓RpCG[NāAR + * pC~B + * Static Asart when compiling + * This function is equal to STATIC_ASSERT of C++ Boost, and is imprementated + * by C language. If the condition is false, a compiler error is caused and + * it stop compiling. + */ +#define XPT_STATIC_ASSERT(cond) extern int xpt_static_assert_array[(cond)?1:-1] + + +/***************************************************************************** + * RpCIvV̌ + * Compiler option test + *****************************************************************************/ + +/* enum^̌ + * @enum^int^ɐ邱Ƃ؂B + * @K؂ȃG[bZ[W\̂ŁA”\ȂRpCIvVɂ + * @`FbNsBs”\ȏꍇAėpIȐÓIAT[gɂ`FbNB + * Enum type test + * It is verified that the enum type adjusts to the int type. + * To display an appropriate error message, it checks the compiler option + * if possible. General static asart test works if it is impossible. + */ +#if defined(__MWERKS__) /* CodeWarrior */ + //#if !__option(enumsalwaysint) + // #error ERROR cri_xpt_post.h : Compiler option 'Enums Always Int' should be ON. + //#endif +#elif defined(__GNUC__) + //#if Compiler option -fshort-enums is used + // #error ERROR cri_xpt_post.h : Compiler option '-fshort-enums' should not be used. + //#endif +#endif +//typedef enum {XPT_TEST_ENUM_0, XPT_TEST_ENUM_1, XPT_TEST_ENUM_2} XptTestEnum; +//XPT_STATIC_ASSERT(sizeof(XptTestEnum) == sizeof(Uint32)); /* enum should be 4byte. */ + +/***************************************************************************** + * 萔}N + * Macros of constant value + *****************************************************************************/ + +/* NULL |C^^ */ +#if !defined(CRI_NULL) +#ifdef __cplusplus +#define CRI_NULL (0) +#else +#define CRI_NULL ((void *)0) +#endif +#endif + +/* _萔PiUA^j */ +#if !defined(CRI_FALSE) +#define CRI_FALSE (0) +#endif +#if !defined(CRI_TRUE) +#define CRI_TRUE (1) +#endif + +/* _萔QiXCb`j */ +#if !defined(CRI_OFF) +#define CRI_OFF (0) +#endif +#if !defined(CRI_ON) +#define CRI_ON (1) +#endif + +/* ʔ̒萔iAsj */ +#if !defined(CRI_OK) +#define CRI_OK (0) /* */ +#endif +#if !defined(CRI_NG) +#define CRI_NG (-1) /* s */ +#endif + +/***************************************************************************** + * |C^܂64rbgAhXi[ł鐮^ + * l: |C^32bitROMAhX64bit̊‹ŁA҂𓧉ߓIɈB + * The integer type which can hold an pointer or an address up to 64 bits. + * NOTE: In the environment of pointer 32bit and ROM address space 64bit, + * this type can treat both transparently. + *****************************************************************************/ + +#if !defined(_TYPEDEF_CriUint64Adr) +#define _TYPEDEF_CriUint64Adr +typedef CriUint64 CriUint64Adr; /* |C^܂64rbgAhXi[ł鐮^ */ +#endif + +#if !defined(CRI_PTR_TO_UINT64ADR) +#define CRI_PTR_TO_UINT64ADR(ptr) ((CriUint64Adr)(ptr)) /* Convert pointer to CriUint64Adr */ +#endif + +#if !defined(CRI_UINT64ADR_TO_PTR) +#define CRI_UINT64ADR_TO_PTR(uint64adr) ((void *)(CriUintPtr)(uint64adr)) /* Convert CriUint64Adr to pointer */ +#endif + +#if !defined(CRI_XPT_DISABLE_UNPREFIXED_TYPE) + +/***************************************************************************** + * ݊ێ̂߂̒萔}N + * Macros for compatibility with old version + *****************************************************************************/ + +/* NULL |C^^ */ +#if !defined(NULL) +#define NULL (CRI_NULL) +#endif + +/* _萔PiUA^j */ +#if !defined(FALSE) +#define FALSE (CRI_FALSE) +#endif +#if !defined(TRUE) +#define TRUE (CRI_TRUE) +#endif + +/* _萔QiXCb`j */ +#if !defined(OFF) +#define OFF (CRI_OFF) +#endif +#if !defined(ON) +#define ON (CRI_ON) +#endif + +/* ʔ̒萔iAsj */ +#if !defined(OK) +#define OK (CRI_OK) +#endif +#if !defined(NG) +#define NG (CRI_NG) +#endif + +/***************************************************************************** + * ݊ێ̂߂̃f[^^錾 + * Types for compatibility with old version + *****************************************************************************/ + +#if !defined(_TYPEDEF_Uint8) +#define _TYPEDEF_Uint8 +typedef CriUint8 Uint8; /* ȂPoCg */ +#endif + +#if !defined(_TYPEDEF_Sint8) +#define _TYPEDEF_Sint8 +typedef CriSint8 Sint8; /* ‚PoCg */ +#endif + +#if !defined(_TYPEDEF_Uint16) +#define _TYPEDEF_Uint16 +typedef CriUint16 Uint16; /* ȂQoCg */ +#endif + +#if !defined(_TYPEDEF_Sint16) +#define _TYPEDEF_Sint16 +typedef CriSint16 Sint16; /* ‚QoCg */ +#endif + +#if !defined(_TYPEDEF_Uint32) +#define _TYPEDEF_Uint32 +typedef CriUint32 Uint32; /* ȂSoCg */ +#endif + +#if !defined(_TYPEDEF_Sint32) +#define _TYPEDEF_Sint32 +typedef CriSint32 Sint32; /* ‚SoCg */ +#endif + +#if !defined(_TYPEDEF_Uint64) +#define _TYPEDEF_Uint64 +typedef CriUint64 Uint64; /* ȂWoCg */ +#endif + +#if !defined(_TYPEDEF_Sint64) +#define _TYPEDEF_Sint64 +typedef CriSint64 Sint64; /* ‚WoCg */ +#endif + +#if !defined(_TYPEDEF_Uint128) +#define _TYPEDEF_Uint128 +typedef CriUint128 Uint128; /* Ȃ16oCg */ +#endif + +#if !defined(_TYPEDEF_Sint128) +#define _TYPEDEF_Sint128 +typedef CriSint128 Sint128; /* ‚16oCg */ +#endif + +#if !defined(_TYPEDEF_Float16) +#define _TYPEDEF_Float16 +typedef CriFloat16 Float16; /* QoCg */ +#endif + +#if !defined(_TYPEDEF_Float32) +#define _TYPEDEF_Float32 +typedef CriFloat32 Float32; /* SoCg */ +#endif + +#if !defined(_TYPEDEF_Float64) +#define _TYPEDEF_Float64 +typedef CriFloat64 Float64; /* WoCg */ +#endif + +#if !defined(_TYPEDEF_Fixed32) +#define _TYPEDEF_Fixed32 +typedef CriFixed32 Fixed32; /* Œ菬_32rbg */ +#endif + +/* X11 APIixtrapproto.hjƂ̋p */ +#if !defined(_TYPEDEF_Bool) && !defined(Bool) +#define _TYPEDEF_Bool +typedef CriBool Bool; /* _^i_萔lɂƂj */ +#endif + +#if !defined(_TYPEDEF_Char8) +#define _TYPEDEF_Char8 +typedef CriChar8 Char8; /* ^ */ +#endif + +#if !defined(_TYPEDEF_SintPtr) +#define _TYPEDEF_SintPtr +typedef CriSintPtr SintPtr; +#endif + +#if !defined(_TYPEDEF_UintPtr) +#define _TYPEDEF_UintPtr +typedef CriUintPtr UintPtr; +#endif + +#endif /* CRI_XPT_DISABLE_UNPREFIXED_TYPE */ + +#endif /* CRI_INCL_CRI_XPT_POST_H */ + +/* end of file */ diff --git a/3rdParty/cri/XboxOne/include/cri_xpts_xboxone.h b/3rdParty/cri/XboxOne/include/cri_xpts_xboxone.h new file mode 100644 index 00000000..589cc56c --- /dev/null +++ b/3rdParty/cri/XboxOne/include/cri_xpts_xboxone.h @@ -0,0 +1,132 @@ +/**************************************************************************** + * + * CRI Middleware SDK + * + * Copyright (c) 1998-2011 CRI Middleware Co., Ltd. + * + * Library : CRI Middleware Library + * Module : CRI Common Header for XboxOne + * File : cri_xpts_xboxone.h + * Date : 2013-03-04 + * Version : 2.05 + * + ****************************************************************************/ + +#ifndef CRI_INCL_CRI_XPTS_H +#define CRI_INCL_CRI_XPTS_H + +/***************************************************************************** + * {f[^^錾 + *****************************************************************************/ + +#if !defined(_TYPEDEF_CriUint8) +#define _TYPEDEF_CriUint8 +typedef unsigned __int8 CriUint8; /* ȂPoCg */ +#endif + +#if !defined(_TYPEDEF_CriSint8) +#define _TYPEDEF_CriSint8 +typedef signed __int8 CriSint8; /* ‚PoCg */ +#endif + +#if !defined(_TYPEDEF_CriUint16) +#define _TYPEDEF_CriUint16 +typedef unsigned __int16 CriUint16; /* ȂQoCg */ +#endif + +#if !defined(_TYPEDEF_CriSint16) +#define _TYPEDEF_CriSint16 +typedef signed __int16 CriSint16; /* ‚QoCg */ +#endif + +#if !defined(_TYPEDEF_CriUint32) +#define _TYPEDEF_CriUint32 +typedef unsigned __int32 CriUint32; /* ȂSoCg */ +#endif + +#if !defined(_TYPEDEF_CriSint32) +#define _TYPEDEF_CriSint32 +typedef signed __int32 CriSint32; /* ‚SoCg */ +#endif + +#if !defined(_TYPEDEF_CriUint64) +#define _TYPEDEF_CriUint64 +typedef unsigned __int64 CriUint64; /* ȂWoCg */ +#endif + +#if !defined(_TYPEDEF_CriSint64) +#define _TYPEDEF_CriSint64 +typedef signed __int64 CriSint64; /* ‚WoCg */ +#endif + +#if !defined(_TYPEDEF_CriUint128) +#define _TYPEDEF_CriUint128 +typedef struct { /* Ȃ16oCg */ + CriUint64 h; /* 64rbg */ + CriUint64 l; /* 64rbg */ +} CriUint128; +#endif + +#if !defined(_TYPEDEF_CriSint128) +#define _TYPEDEF_CriSint128 +typedef struct { /* ‚16oCg */ + CriSint64 h; /* 64rbg */ + CriUint64 l; /* 64rbg */ +} CriSint128; +#endif + +#if !defined(_TYPEDEF_CriFloat16) +#define _TYPEDEF_CriFloat16 +typedef signed __int16 CriFloat16; /* QoCg */ +#endif + +#if !defined(_TYPEDEF_CriFloat32) +#define _TYPEDEF_CriFloat32 +typedef float CriFloat32; /* SoCg */ +#endif + +#if !defined(_TYPEDEF_CriFloat64) +#define _TYPEDEF_CriFloat64 +typedef double CriFloat64; /* WoCg */ +#endif + +#if !defined(_TYPEDEF_CriFixed32) +#define _TYPEDEF_CriFixed32 +typedef signed __int32 CriFixed32; /* Œ菬_32rbg */ +#endif + +#if !defined(_TYPEDEF_CriBool) +#define _TYPEDEF_CriBool +typedef CriSint32 CriBool; /* _^i_萔lɂƂj */ +#endif + +#if !defined(_TYPEDEF_CriChar8) +#define _TYPEDEF_CriChar8 +typedef char CriChar8; /* ^ */ +#endif + +/***************************************************************************** + * |C^i[”\Ȑ^ + *****************************************************************************/ + +#if !defined(_TYPEDEF_CriSintPtr) +#define _TYPEDEF_CriSintPtr +typedef signed __int64 CriSintPtr; +#endif + +#if !defined(_TYPEDEF_CriUintPtr) +#define _TYPEDEF_CriUintPtr +typedef unsigned __int64 CriUintPtr; +#endif + +/***************************************************************************** + * ĂяoK + *****************************************************************************/ + +#if !defined(CRIAPI) +#define CRIAPI __cdecl +#endif + +#endif /* CRI_INCL_CRI_XPTS_H */ + +/* end of file */ diff --git a/3rdParty/cri/XboxOne/libs/cri_base_xboxone.lib b/3rdParty/cri/XboxOne/libs/cri_base_xboxone.lib new file mode 100644 index 00000000..9b35306e Binary files /dev/null and b/3rdParty/cri/XboxOne/libs/cri_base_xboxone.lib differ diff --git a/3rdParty/cri/XboxOne/libs/cri_movie_xboxone.lib b/3rdParty/cri/XboxOne/libs/cri_movie_xboxone.lib new file mode 100644 index 00000000..9ad045c4 Binary files /dev/null and b/3rdParty/cri/XboxOne/libs/cri_movie_xboxone.lib differ diff --git a/3rdParty/cri/orbis/include/cri_allocator.h b/3rdParty/cri/orbis/include/cri_allocator.h new file mode 100644 index 00000000..e3c18997 --- /dev/null +++ b/3rdParty/cri/orbis/include/cri_allocator.h @@ -0,0 +1,63 @@ +#ifndef _CRI_ALLOCATOR_H_INCLUDED +#define _CRI_ALLOCATOR_H_INCLUDED +/**************************************************************************** + * * + * CRI Allocator * + * * + * 2006-01-05 written by M.Oshimi * + * * + ****************************************************************************/ + +/**************************************************************************** + * Include file + ****************************************************************************/ +#include +#include "cri_xpt.h" +#include "cri_heap.h" + +/**************************************************************************** + * Macro Constants + ****************************************************************************/ +#if defined(XPT_UNSUPPORT_CPLUSPLUS_THROW) +#define CRI_ALLOCATOR_CPLUSPLUS_THROW +#else +#define CRI_ALLOCATOR_CPLUSPLUS_THROW throw() +#endif + +/**************************************************************************** + * Class Declaration + ****************************************************************************/ +#ifdef __cplusplus + +class CriAllocator +{ +public: + static const CriSint32 DEFAULT_ALIGNMENT = CRIHEAP_DEFAULT_MEM_ALIGN; + + + static void* CRIAPI operator new(size_t size, CriHeap heap) CRI_ALLOCATOR_CPLUSPLUS_THROW; + static void* CRIAPI operator new(size_t size, CriHeap heap, CriHeapType heap_type) CRI_ALLOCATOR_CPLUSPLUS_THROW; + static void* CRIAPI operator new(size_t size, CriHeap heap, const CriChar8 *name, CriUint32 align=DEFAULT_ALIGNMENT) CRI_ALLOCATOR_CPLUSPLUS_THROW; + static void* CRIAPI operator new(size_t size, CriHeap heap, CriHeapType heap_type, const CriChar8 *name, CriUint32 align=DEFAULT_ALIGNMENT) CRI_ALLOCATOR_CPLUSPLUS_THROW; + + static void CRIAPI operator delete(void *p, size_t size); + + static void* CRIAPI operator new(size_t size, void *work, CriSint32 wksize) CRI_ALLOCATOR_CPLUSPLUS_THROW; + static void CRIAPI operator delete(void *p, void *work, CriSint32 wksize) CRI_ALLOCATOR_CPLUSPLUS_THROW; + static void* CRIAPI operator new(size_t size, void *work, CriSint32 wksize, CriUint32 align) CRI_ALLOCATOR_CPLUSPLUS_THROW; + static void CRIAPI operator delete(void *p, void *work, CriSint32 wksize, CriUint32 align) CRI_ALLOCATOR_CPLUSPLUS_THROW; + +#if !defined(XPT_TGT_BCB) + static void CRIAPI operator delete(void *p, CriHeap heap) CRI_ALLOCATOR_CPLUSPLUS_THROW; + static void CRIAPI operator delete(void *p, CriHeap heap, CriHeapType heap_type) CRI_ALLOCATOR_CPLUSPLUS_THROW; + static void CRIAPI operator delete(void *p, CriHeap heap, const CriChar8 *name, CriUint32 align) CRI_ALLOCATOR_CPLUSPLUS_THROW; + static void CRIAPI operator delete(void *p, CriHeap heap, CriHeapType heap_type, const CriChar8 *name, CriUint32 align) CRI_ALLOCATOR_CPLUSPLUS_THROW; +#endif + + static CriSint32 GetWorstExtraSize(CriUint32 align); +}; +#endif // _CRI_ALLOCATOR_H_INCLUDED + +#endif /* end of __cplusplus */ + +/* --- end of file --- */ diff --git a/3rdParty/cri/orbis/include/cri_error.h b/3rdParty/cri/orbis/include/cri_error.h new file mode 100644 index 00000000..6152a7b5 --- /dev/null +++ b/3rdParty/cri/orbis/include/cri_error.h @@ -0,0 +1,368 @@ +#ifndef _CRI_ERROR_H_INCLUDED +#define _CRI_ERROR_H_INCLUDED +/**************************************************************************** + * + * CRI Middleware SDK + * + * Copyright (c) 2006-2009 CRI Middleware Co., Ltd. + * + * Library : CRI Error + * Module : + * File : cri_error.h + * + ****************************************************************************/ +/*! + * \file cri_error.h + */ +/*JP + * \addtogroup CRI_ERROR G[nhOp֐Q + * @{ + */ +/*EN + * \addtogroup CRI_ERROR Functions for error handling + * @{ + */ + +/**************************************************************************** + * Include file * + ****************************************************************************/ +#include "cri_xpt.h" + +/**************************************************************************** + * MACRO CONSTANT * + ****************************************************************************/ + +/* o[Wԍ */ +/* Version number */ +#define CRIERROR_VER_NAME "CRI Error" +#define CRIERROR_VER_NUM "1.04.00" +#define CRIERROR_VER_OPTION + +/*JP + * \brief G[R[h + */ +/*EN + * \brief Error codes + */ +typedef enum { + CRIERR_OK = 0, /*JP< I */ + /*EN< Succeeded */ + CRIERR_NG = -1, /*JP< G[ */ + /*EN< Error occurred */ + CRIERR_INVALID_PARAMETER = -2, /*JP< s */ + /*EN< Invalid argument */ + CRIERR_FAILED_TO_ALLOCATE_MEMORY = -3, /*JP< ̊mۂɎs */ + /*EN< Failed to allocate memory */ + CRIERR_UNSAFE_FUNCTION_CALL = -4, /*JP< XbhZ[t֐̕s */ + /*EN< Parallel execution of thread-unsafe function */ + CRIERR_FUNCTION_NOT_IMPLEMENTED = -5, /*JP< ֐̎s */ + /*EN< Function not implemented */ + CRIERR_LIBRARY_NOT_INITIALIZED = -6, /*JP< Cu */ + /*EN< Library not initialized */ + /* enum be 4bytes */ + CRIERR_ENUM_BE_SINT32 = 0x7FFFFFFF +} CriError; + +/*JP + * \brief G[ʒmx + */ +/*EN + * \brief Error notification level + */ +typedef enum { + CRIERR_NOTIFY_ALL = 0, /*JP< SẴG[ʒm */ + /*EN< Notify all errors */ + CRIERR_NOTIFY_FATAL = 1, /*JP< G[̂ݒʒmix͖j */ + /*EN< Notify error (Disregards warning) */ + /* enum be 4bytes */ + CRIERR_NOTIFY_ENUM_BE_SINT32 = 0x7FFFFFFF +} CriErrorNotificationLevel; + +/* G[x */ +/* Error level */ +typedef enum { + CRIERR_LEVEL_ERROR = 0, + CRIERR_LEVEL_WARNING = 1, + /* enum be 4bytes */ + CRIERR_LEVEL_ENUM_BE_SINT32 = 0x7FFFFFFF +} CriErrorLevel; + +/**************************************************************************** + * PROCESS MACRO * + ****************************************************************************/ + +#if defined(CRIERROR_SIMPLIFY) + /* G[̒ʒm */ + /* Notification of Error */ + #define criErr_NotifyError(id, msg) criErr_NotifyErrorSimple() + #define criErr_NotifyError1(id, msg, p1) criErr_NotifyErrorSimple() + #define criErr_NotifyError2(id, msg, p1, p2) criErr_NotifyErrorSimple() + #define criErr_NotifyErrorPrmArray(id, msg, p1, p2, pa) criErr_NotifyErrorSimple() + #define criErr_NotifyErrorGeneric(_error_id, _error_no) criErr_NotifyErrorSimple() + /* x̒ʒm */ + /* Notification of Warning */ + #define criErr_NotifyWarning(id, msg) criErr_NotifyWarningSimple() + #define criErr_NotifyWarning1(id, msg, p1) criErr_NotifyWarningSimple() + #define criErr_NotifyWarning2(id, msg, p1, p2) criErr_NotifyWarningSimple() + #define criErr_NotifyWarningPrmArray(id, msg, p1, p2, pa) criErr_NotifyWarningSimple() + #define criErr_NotifyWarningGeneric(_error_id, _error_no) criErr_NotifyWarningSimple() +#else + /* G[̒ʒm */ + /* Notification of Error */ + #define criErr_NotifyError(id, msg) criErr_Notify(CRIERR_LEVEL_ERROR, id ":" msg) + #define criErr_NotifyError1(id, msg, p1) criErr_Notify1(CRIERR_LEVEL_ERROR, (id ":" msg), (CriUintPtr)(p1)) + #define criErr_NotifyError2(id, msg, p1, p2) criErr_Notify2(CRIERR_LEVEL_ERROR, (id ":" msg), (CriUintPtr)(p1), (CriUintPtr)(p2)) + #define criErr_NotifyErrorPrmArray(id, msg, p1, p2, pa) criErr_NotifyPrmArray(CRIERR_LEVEL_ERROR, (id ":" msg), (CriUintPtr)(p1), (CriUintPtr)(p2), (CriUintPtr *)(pa)) + #define criErr_NotifyErrorGeneric(_error_id, _error_no) criErr_NotifyGeneric(CRIERR_LEVEL_ERROR, _error_id, _error_no) + /* x̒ʒm */ + /* Notification of Warning */ + #define criErr_NotifyWarning(id, msg) criErr_Notify(CRIERR_LEVEL_WARNING, id ":" msg) + #define criErr_NotifyWarning1(id, msg, p1) criErr_Notify1(CRIERR_LEVEL_WARNING, (id ":" msg), (CriUintPtr)(p1)) + #define criErr_NotifyWarning2(id, msg, p1, p2) criErr_Notify2(CRIERR_LEVEL_WARNING, (id ":" msg), (CriUintPtr)(p1), (CriUintPtr)(p2)) + #define criErr_NotifyWarningPrmArray(id, msg, p1, p2, pa) criErr_NotifyPrmArray(CRIERR_LEVEL_WARNING, (id ":" msg), (CriUintPtr)(p1), (CriUintPtr)(p2), (CriUintPtr *)(pa)) + #define criErr_NotifyWarningGeneric(_error_id, _error_no) criErr_NotifyGeneric(CRIERR_LEVEL_WARNING, _error_id, _error_no) +#endif + +/**************************************************************************** + * Data type declaration * + ****************************************************************************/ + +/* Error Callback Function type */ +typedef void (CRIAPI *CriErrCbFunc)(const CriChar8 *errid, CriUint32 p1, CriUint32 p2, CriUint32 *parray); + +/**************************************************************************** + * ϐ̐錾 * + * Variable Declaration * + ****************************************************************************/ +/* G[o͏ȗpϐ */ +/* default argument of CriError */ +#ifdef __cplusplus +namespace criErr { + extern CriError ErrorContainer; +} +#endif /* __cplusplus */ + +/**************************************************************************** + * ֐̐錾 * + * Function Declaration * + ****************************************************************************/ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +/*JP + * \brief G[ID񂩂G[bZ[W֕ϊ + * \ingroup CRI_ERROR + * \param[in] errid G[ID + * \return G[bZ[W + * \par : + * G[ID񂩂ڍׂȃG[bZ[W֕ϊ܂B
+ * \attention + * ̊֐͋dl̊֐łB
+ * ::criErr_ConvertIdToMessage ֐gpĂB + * \sa criErr_ConvertIdToMessage + */ +/*EN + * \brief Convert error ID to error message + * \ingroup CRI_ERROR + * \param[in] errid error ID + * \return error message + * \par Explanation: + * This function converts error ID to detailed error message.
+ * \attention + * This function is an obsolete one.
+ * Please use the ::criErr_ConvertIdToMessage function instead. + * \sa criErr_ConvertIdToMessage + */ +const CriChar8* CRIAPI criErr_ConvertIdToMsg(const CriChar8 *errid); + +/*JP + * \brief G[ID񂩂G[bZ[W֕ϊ + * \ingroup CRI_ERROR + * \param[in] errid G[ID + * \param[in] p1 ⑫1 + * \param[in] p2 ⑫2 + * \return G[bZ[W + * \par : + * G[ID񂩂ڍׂȃG[bZ[W֕ϊ܂B
+ * \par p: + * \code + * void user_error_callback_func(const CriChar8 *errid, CriUint32 p1, CriUint32 p2, CriUint32 *parray); + * { + * const CriChar8 *errmsg; + * errmsg = criErr_ConvertIdToMessage(errid, p1, p2); + * printf("%s\n", errmsg); + * } + * \endcode + */ +/*EN + * \brief Convert error ID to error message + * \ingroup CRI_ERROR + * \param[in] errid error ID + * \param[in] p1 supplementary information 1 + * \param[in] p2 supplementary information 2 + * \return error message + * \par Explanation: + * This function converts error ID to detailed error message.
+ * \par Example: + * \code + * void user_error_callback_func(const CriChar8 *errid, CriUint32 p1, CriUint32 p2, CriUint32 *parray); + * { + * const CriChar8 *errmsg; + * errmsg = criErr_ConvertIdToMessage(errid, p1, p2); + * printf("%s\n", errmsg); + * } + * \endcode + */ +const CriChar8* CRIAPI criErr_ConvertIdToMessage(const CriChar8 *errid, CriUint32 p1, CriUint32 p2); + +/*JP + * \brief G[R[obN֐̓o^ + * \ingroup CRI_ERROR + * \param[in] cbf G[R[obN֐ + * \return Ȃ + * \par : + * G[R[obN֐o^܂B
+ * o^ꂽ֐́ACRI~hEGACuŃG[ƂɌĂяo܂B
+ * ɓo^łG[R[obN֐͂P‚łB
+ * o^ɍēx{֐Ăяoꍇ݂͌̓o^㏑܂B + * \par p: + * \code + * void user_error_callback_func(const CriChar8 *errid, CriUint32 p1, CriUint32 p2, CriUint32 *parray); + * { + * const CriChar8 *errmsg; + * errmsg = criErr_ConvertIdToMessage(errid, p1, p2); + * printf("%s\n", errmsg); + * } + * + * void main(int ac, char *av[]) + * { + * F + * // G[R[obN̓o^ + * criErr_SetCallback(user_error_callback_func); + * F + * } + * \endcode + */ +/*EN + * \brief Register error callback function + * \ingroup CRI_ERROR + * \param[in] cbf error callback function + * \return NONE + * \par Explanation: + * This function registers an error callback function.
+ * The registered function is called if an error occurs within the CRI middleware library. + * \par Example: + * \code + * void user_error_callback_func(const CriChar8 *errid, CriUint32 p1, CriUint32 p2, CriUint32 *parray); + * { + * const CriChar8 *errmsg; + * errmsg = criErr_ConvertIdToMessage(errid, p1, p2); + * printf("%s\n", errmsg); + * } + * + * void main(int ac, char *av[]) + * { + * : + * // Registers the error callback function + * criErr_SetCallback(user_error_callback_func); + * : + * } + * \endcode + */ +void CRIAPI criErr_SetCallback(CriErrCbFunc cbf); + +/*JP + * \brief G[ʒmx̕ύX + * \ingroup CRI_ERROR + * \param[in] level G[ʒmx + * \return Ȃ + * \par : + * G[R[obNɒʒmG[̃xύX܂B + */ +/*EN + * \brief Change error notification level + * \ingroup CRI_ERROR + * \param[in] level error notification level + * \return NONE + * \par Explanation: + * This function changes the level of error information that is notified to the error callback. + */ +void CRIAPI criErr_SetErrorNotificationLevel(CriErrorNotificationLevel level); + +/*JP + * \brief G[񐔂̎擾 + * \ingroup CRI_ERROR + * \param[in] level G[x + * \return G[ + * \par : + * G[񐔂擾܂B + */ +/*EN + * \brief Retrieve error count + * \ingroup CRI_ERROR + * \param[in] level error level + * \return number of errors occured + * \par Explanation: + * This function retrieves the number of errors occured. + */ +CriUint32 CRIAPI criErr_GetErrorCount(CriErrorLevel level); + +/*JP + * \brief G[񐔂̃Zbg + * \ingroup CRI_ERROR + * \param[in] level G[x + * \return Ȃ + * \par : + * G[񐔂̃JE^0ɖ߂܂B + */ +/*EN + * \brief Resets error count + * \ingroup CRI_ERROR + * \param[in] level error level + * \return NONE + * \par Explanation: + * This function resets the counter for number of errors occured. + */ +void CRIAPI criErr_ResetErrorCount(CriErrorLevel level); + +/* G[R[obN𔭐 (֐) */ +/* Error notification (Internal functions) */ +void CRIAPI criErr_Notify(CriErrorLevel level, const CriChar8 *errid); +void CRIAPI criErr_Notify1(CriErrorLevel level, const CriChar8 *errid, CriUintPtr p1); +void CRIAPI criErr_Notify2(CriErrorLevel level, const CriChar8 *errid, CriUintPtr p1, CriUintPtr p2); +void CRIAPI criErr_NotifyPrmArray(CriErrorLevel level, const CriChar8 *errid, CriUintPtr p1, CriUintPtr p2, CriUintPtr *pa); +void CRIAPI criErr_NotifyGeneric(CriErrorLevel level, const CriChar8 *error_id, CriError error_no); +void CRIAPI criErr_NotifyErrorSimple(void); +void CRIAPI criErr_NotifyWarningSimple(void); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +/*************************************************************************** + * o[WƂ̌݊p + * For compatibility with old versions + ***************************************************************************/ +#define criErr_Invoke(errid) criErr_Notify(CRIERR_LEVEL_ERROR, errid) +#define criErr_Invoke1(errid, p1) criErr_Notify1(CRIERR_LEVEL_ERROR, errid, p1) +#define criErr_Invoke2(errid, p1, p2) criErr_Notify2(CRIERR_LEVEL_ERROR, errid, p1, p2) +#define criErr_InvokePrmArray(errid, p1, p2, pa) criErr_NotifyPrmArray(CRIERR_LEVEL_ERROR, errid, p1, p2, pa) +#define criErr_InvokeGeneric(error_id, error_no) criErr_NotifyGeneric(CRIERR_LEVEL_ERROR, error_id, error_no) +#define criErr_Occur(id, msg) criErr_Notify(CRIERR_LEVEL_ERROR, id ":" msg) +#define criErr_Occur1(id, msg, p1) criErr_Notify1(CRIERR_LEVEL_ERROR, (id ":" msg), (CriUintPtr)(p1)) +#define criErr_Occur2(id, msg, p1, p2) criErr_Notify2(CRIERR_LEVEL_ERROR, (id ":" msg), (CriUintPtr)(p1), (CriUintPtr)(p2)) +#define criErr_OccurPrmArray(id, msg, p1, p2, pa) criErr_NotifyPrmArray(CRIERR_LEVEL_ERROR, (id ":" msg), (CriUintPtr)(p1), (CriUintPtr)(p2), (CriUintPtr*)(pa)) +#define criErr_OccurGeneric(_error_id, _error_no) criErr_NotifyGeneric(CRIERR_LEVEL_ERROR, _error_id, _error_no) + +/*EN + * @} + */ +/*JP + * @} + */ + +#endif // _CRI_ERROR_H_INCLUDED + +/* --- end of file --- */ diff --git a/3rdParty/cri/orbis/include/cri_sj.h b/3rdParty/cri/orbis/include/cri_sj.h new file mode 100644 index 00000000..9b7047b4 --- /dev/null +++ b/3rdParty/cri/orbis/include/cri_sj.h @@ -0,0 +1,189 @@ +/**************************************************************************** + * + * CRI Middleware SDK + * + * Copyright (c) 2006-2010 CRI Middleware Co., Ltd. + * + ****************************************************************************/ + +#ifndef _CRI_SJ_H_INCLUDED +#define _CRI_SJ_H_INCLUDED +/**************************************************************************** + * * + * CRI Stream Joint "CriSj" Library * + * * + * 2005-06-21 written by M.Oshimi * + * * + ****************************************************************************/ + +/**************************************************************************** + * Include file * + ****************************************************************************/ +#include "cri_xpt.h" +#include "cri_heap.h" + +/**************************************************************************** + * MACRO CONSTANT * + ****************************************************************************/ + +/* Version number of CriSj */ +#define CRISJ_NAME_STRINGS "CRI Stream Joint" +#define CRISJ_VERSION_STRINGS "1.01.00" + +#define CRISJUNI_MAX_LINE (4) +#define CRICHUNK_MAX_SIZE (0xffffffff) + +/*********************************************************************** + * Process MACRO + ***********************************************************************/ + +/**************************************************************************** + * Data type declaration * + ****************************************************************************/ + +/* Xg[C */ +typedef enum { + CRISJ_LINE_FREE = (0), + CRISJ_LINE_DATA = (1), + CRISJ_LINE_HOLD = (2), + CRISJ_LINE_EXTRA = (3), + /* enum be 4bytes */ + CRISJ_LINE_ENUM_BE_SINT32 = 0x7FFFFFFF +} CriSjLine; + +/* `N */ +#ifndef TYPEDEF_CRICHUNK +#define TYPEDEF_CRICHUNK +typedef struct { + CriUint8 *data; /* f[^ */ + CriUint32 size; /* oCg */ +} CriChunk; +#endif + +/* CriSjnh */ +/* CriSj handle */ +typedef struct { + struct _crisj_function_table *vtbl; + const CriChar8 *name; +} CriSjObj, *CriSj; + +typedef struct _crisj_function_table { + /* nh̏ */ + void (*Destroy)(CriSj sj); + /* Zbg */ + void (*Reset)(CriSj sj); + /* `N̎擾 (FIFO̐擪擾) */ + void (*GetChunk)(CriSj sj, CriSjLine id, CriUint32 nbyte, CriChunk *ck); + /* `N߂@(FIFO̐擪ɑ}) */ + void (*UngetChunk)(CriSj sj, CriSjLine id, CriChunk *ck); + /* `N} (FIFO̍Ōɑ}) */ + void (*PutChunk)(CriSj sj, CriSjLine id, CriChunk *ck); + /* C擾ł鑍oCg̎擾 */ + CriUint32 (*GetTotalSize)(CriSj sj, CriSjLine id); +} CriSjVirtualFunctionTable; + +typedef enum { + CRISJ_UNIMODE_SEPARATE = (0), + CRISJ_UNIMODE_JOIN = (1), + /* enum be 4bytes */ + CRISJ_UNIMODE_ENUM_BE_SINT32 = 0x7FFFFFFF +} CriSjUniversalMode; + + +typedef struct CriSjRbfConfig { + CriBool use_cs; + CriUint32 buffer_size; + CriUint32 extra_size; + CriUint32 alignment; + const CriChar8 *buffer_name; +} CriSjRbfConfig; + +typedef struct CriSjMemConfig { + CriBool use_cs; + CriUint8 *data; + CriUint32 data_size; +} CriSjMemConfig; + +typedef struct CriSjUniConfig { + CriBool use_cs; + CriSjUniversalMode mode; + CriUint32 num_chunks; +} CriSjUniConfig; + +/**************************************************************************** + * Function Declaration * + ****************************************************************************/ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +/* Oobt@^SJ̍쐬 */ +CriSint32 CRIAPI criSjRbf_CalculateWorkSize(const CriSjRbfConfig* config); +CriSj CRIAPI criSjRbf_Create(const CriSjRbfConfig *config, void *work, CriSint32 work_size); +CriSj CRIAPI criSjRbf_CreateByHeap(const CriSjRbfConfig *config, CriHeap heap, CriHeapType heap_type); + +/* 풓^SJ̍쐬 */ +CriSint32 CRIAPI criSjMem_CalculateWorkSize(const CriSjMemConfig* config); +CriSj CRIAPI criSjMem_Create(const CriSjMemConfig *config, void *work, CriSint32 work_size); +CriSj CRIAPI criSjMem_CreateByHeap(const CriSjMemConfig *config, CriHeap heap, CriHeapType heap_type); + +/* jo[TSJ̍쐬 */ +CriSint32 CRIAPI criSjUni_CalculateWorkSize(const CriSjUniConfig* config); +CriSj CRIAPI criSjUni_Create(const CriSjUniConfig *config, void *work, CriSint32 work_size); +CriSj CRIAPI criSjUni_CreateByHeap(const CriSjUniConfig *config, CriHeap heap, CriHeapType heap_type); +/* `FCv[̎擾 */ +CriSint32 CRIAPI criSjUni_GetNumChainPool(CriSj sj); + +void CRIAPI criSj_Destroy(CriSj sj); +void CRIAPI criSj_Reset(CriSj sj); +void CRIAPI criSj_GetChunk(CriSj sj, CriSjLine line, CriUint32 nbyte, CriChunk *ck); +void CRIAPI criSj_UngetChunk(CriSj sj, CriSjLine line, CriChunk *ck); +void CRIAPI criSj_PutChunk(CriSj sj, CriSjLine line, CriChunk *ck); +CriUint32 CRIAPI criSj_GetTotalSize(CriSj sj, CriSjLine line); +void CRIAPI criSj_SplitChunk(CriChunk *ck, CriUint32 nbyte, CriChunk *ck1, CriChunk *ck2); + +/*** +* New APIs +***/ + +CriUint32 CRIAPI criSj_GetInputFreeSize(CriSj sj); +void CRIAPI criSj_GetInputChunk(CriSj sj, CriChunk *ck); +void CRIAPI criSj_PutInputChunk(CriSj sj, CriChunk *ck, CriUint32 input_size); +CriUint32 CRIAPI criSj_GetOutputDataSize(CriSj sj); +void CRIAPI criSj_GetOutputChunk(CriSj sj, CriChunk *ck); +void CRIAPI criSj_PutOutputChunk(CriSj sj, CriChunk *ck, CriUint32 output_size); + +CriUint32 CRIAPI criSj_PutOutputChunk2(CriSj sj, CriChunk *ck1, CriChunk *ck2, CriUint32 output_size); + + +/*** +* Old Interface (for compatibility) +***/ +typedef struct _CriSjConfig { + CriBool use_cs; + CriHeapType heap_type; +} CriSjConfig; + +CriSj CRIAPI criSj_CreateRingBuffer(CriHeap heap, CriUint32 bsize, CriUint32 xsize, CriUint32 align); +CriSj CRIAPI criSj_CreateNamedRingBuffer(CriHeap heap, CriUint32 bsize, CriUint32 xsize, CriUint32 align, const CriChar8 *bname); +CriSj CRIAPI criSj_CreateRingBufferWithConfig(CriHeap heap, CriUint32 bsize, CriUint32 xsize, CriUint32 align, const CriSjConfig *config); +CriSj CRIAPI criSj_CreateNamedRingBufferWithConfig(CriHeap heap, CriUint32 bsize, CriUint32 xsize, CriUint32 align, const CriChar8 *bname, const CriSjConfig *config); +CriSint32 CRIAPI criSjRbf_GetRequiredMemorySizeWithConfig(CriUint32 bsize, CriUint32 xsize, CriUint32 align, const CriSjConfig *config); + +CriSj CRIAPI criSj_CreateMemory(CriHeap heap, CriUint8 *data, CriUint32 dtsize, CriUint32 align); +CriSj CRIAPI criSj_CreateMemoryWithConfig(CriHeap heap, CriUint8 *data, CriUint32 dtsize, CriUint32 align, const CriSjConfig *config); +CriSint32 CRIAPI criSjMem_GetRequiredMemorySizeWithConfig(CriUint32 align, const CriSjConfig *config); + +CriSj CRIAPI criSj_CreateUniversal(CriHeap heap, CriSjUniversalMode mode, CriUint32 nchunk); +CriSj CRIAPI criSj_CreateUniversalWithConfig(CriHeap heap, CriSjUniversalMode mode, CriUint32 nchunk, const CriSjConfig *config); +CriSint32 CRIAPI criSjUni_GetRequiredMemorySizeWithConfig(CriSjUniversalMode mode, CriUint32 nchunk, const CriSjConfig *config); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + + +#endif + +/* end of file */ diff --git a/3rdParty/cri/orbis/include/cri_xpt.h b/3rdParty/cri/orbis/include/cri_xpt.h new file mode 100644 index 00000000..8f3d09a0 --- /dev/null +++ b/3rdParty/cri/orbis/include/cri_xpt.h @@ -0,0 +1,27 @@ +/**************************************************************************** + * + * CRI Middleware SDK + * + * Copyright (c) 2012 CRI Middleware Co., Ltd. + * + * Library : CRI Middleware Library + * Module : CRI Common Header for PS4 + * File : cri_xpt.h + * Date : 2012-10-04 + * Version : 1.00 + * + ****************************************************************************/ +#ifndef CRI_INCL_CRI_XPT_H +#define CRI_INCL_CRI_XPT_H + +#define XPT_TGT_PS4 +#define XPT_CCS_LEND +#define XPT_DISABLE_FSV1API +#define CRI_TARGET_STR "PS4" + + +#include "cri_xpts_orbis.h" +#include "cri_xpt_post.h" + +#endif /* CRI_INCL_CRI_XPT_H */ +/* End Of File */ diff --git a/3rdParty/cri/orbis/include/cri_xpt_post.h b/3rdParty/cri/orbis/include/cri_xpt_post.h new file mode 100644 index 00000000..de333b7b --- /dev/null +++ b/3rdParty/cri/orbis/include/cri_xpt_post.h @@ -0,0 +1,256 @@ +/***************************************************************************** + * + * CRI Middleware SDK + * + * Copyright (c) 1998-2012 CRI Middleware Co., Ltd. + * + * Library : CRI Middleware Library + * Module : CRI Common Header / Post-Process + * File : cri_xpt_post.h + * Date : 2012-05-15 + * Version : 2.07 + * + *****************************************************************************/ +#ifndef CRI_INCL_CRI_XPT_POST_H +#define CRI_INCL_CRI_XPT_POST_H + + +/***************************************************************************** + * }N` + * Macro definition + *****************************************************************************/ + +/* RpC̐ÓIAT[g + * C++ BoostSTATIC_ASSERTƓ̋@\CŎB + * ^ł邱Ƃ؂BȔꍇ̓RpCG[NāAR + * pC~B + * Static Asart when compiling + * This function is equal to STATIC_ASSERT of C++ Boost, and is imprementated + * by C language. If the condition is false, a compiler error is caused and + * it stop compiling. + */ +#define XPT_STATIC_ASSERT(cond) extern int xpt_static_assert_array[(cond)?1:-1] + + +/***************************************************************************** + * RpCIvV̌ + * Compiler option test + *****************************************************************************/ + +/* enum^̌ + * @enum^int^ɐ邱Ƃ؂B + * @K؂ȃG[bZ[W\̂ŁA”\ȂRpCIvVɂ + * @`FbNsBs”\ȏꍇAėpIȐÓIAT[gɂ`FbNB + * Enum type test + * It is verified that the enum type adjusts to the int type. + * To display an appropriate error message, it checks the compiler option + * if possible. General static asart test works if it is impossible. + */ +#if defined(__MWERKS__) /* CodeWarrior */ + //#if !__option(enumsalwaysint) + // #error ERROR cri_xpt_post.h : Compiler option 'Enums Always Int' should be ON. + //#endif +#elif defined(__GNUC__) + //#if Compiler option -fshort-enums is used + // #error ERROR cri_xpt_post.h : Compiler option '-fshort-enums' should not be used. + //#endif +#endif +//typedef enum {XPT_TEST_ENUM_0, XPT_TEST_ENUM_1, XPT_TEST_ENUM_2} XptTestEnum; +//XPT_STATIC_ASSERT(sizeof(XptTestEnum) == sizeof(Uint32)); /* enum should be 4byte. */ + +/***************************************************************************** + * 萔}N + * Macros of constant value + *****************************************************************************/ + +/* NULL |C^^ */ +#if !defined(CRI_NULL) +#ifdef __cplusplus +#define CRI_NULL (0) +#else +#define CRI_NULL ((void *)0) +#endif +#endif + +/* _萔PiUA^j */ +#if !defined(CRI_FALSE) +#define CRI_FALSE (0) +#endif +#if !defined(CRI_TRUE) +#define CRI_TRUE (1) +#endif + +/* _萔QiXCb`j */ +#if !defined(CRI_OFF) +#define CRI_OFF (0) +#endif +#if !defined(CRI_ON) +#define CRI_ON (1) +#endif + +/* ʔ̒萔iAsj */ +#if !defined(CRI_OK) +#define CRI_OK (0) /* */ +#endif +#if !defined(CRI_NG) +#define CRI_NG (-1) /* s */ +#endif + +/***************************************************************************** + * |C^܂64rbgAhXi[ł鐮^ + * l: |C^32bitROMAhX64bit̊‹ŁA҂𓧉ߓIɈB + * The integer type which can hold an pointer or an address up to 64 bits. + * NOTE: In the environment of pointer 32bit and ROM address space 64bit, + * this type can treat both transparently. + *****************************************************************************/ + +#if !defined(_TYPEDEF_CriUint64Adr) +#define _TYPEDEF_CriUint64Adr +typedef CriUint64 CriUint64Adr; /* |C^܂64rbgAhXi[ł鐮^ */ +#endif + +#if !defined(CRI_PTR_TO_UINT64ADR) +#define CRI_PTR_TO_UINT64ADR(ptr) ((CriUint64Adr)(ptr)) /* Convert pointer to CriUint64Adr */ +#endif + +#if !defined(CRI_UINT64ADR_TO_PTR) +#define CRI_UINT64ADR_TO_PTR(uint64adr) ((void *)(CriUintPtr)(uint64adr)) /* Convert CriUint64Adr to pointer */ +#endif + +#if !defined(CRI_XPT_DISABLE_UNPREFIXED_TYPE) + +/***************************************************************************** + * ݊ێ̂߂̒萔}N + * Macros for compatibility with old version + *****************************************************************************/ + +/* NULL |C^^ */ +#if !defined(NULL) +#define NULL (CRI_NULL) +#endif + +/* _萔PiUA^j */ +#if !defined(FALSE) +#define FALSE (CRI_FALSE) +#endif +#if !defined(TRUE) +#define TRUE (CRI_TRUE) +#endif + +/* _萔QiXCb`j */ +#if !defined(OFF) +#define OFF (CRI_OFF) +#endif +#if !defined(ON) +#define ON (CRI_ON) +#endif + +/* ʔ̒萔iAsj */ +#if !defined(OK) +#define OK (CRI_OK) +#endif +#if !defined(NG) +#define NG (CRI_NG) +#endif + +/***************************************************************************** + * ݊ێ̂߂̃f[^^錾 + * Types for compatibility with old version + *****************************************************************************/ + +#if !defined(_TYPEDEF_Uint8) +#define _TYPEDEF_Uint8 +typedef CriUint8 Uint8; /* ȂPoCg */ +#endif + +#if !defined(_TYPEDEF_Sint8) +#define _TYPEDEF_Sint8 +typedef CriSint8 Sint8; /* ‚PoCg */ +#endif + +#if !defined(_TYPEDEF_Uint16) +#define _TYPEDEF_Uint16 +typedef CriUint16 Uint16; /* ȂQoCg */ +#endif + +#if !defined(_TYPEDEF_Sint16) +#define _TYPEDEF_Sint16 +typedef CriSint16 Sint16; /* ‚QoCg */ +#endif + +#if !defined(_TYPEDEF_Uint32) +#define _TYPEDEF_Uint32 +typedef CriUint32 Uint32; /* ȂSoCg */ +#endif + +#if !defined(_TYPEDEF_Sint32) +#define _TYPEDEF_Sint32 +typedef CriSint32 Sint32; /* ‚SoCg */ +#endif + +#if !defined(_TYPEDEF_Uint64) +#define _TYPEDEF_Uint64 +typedef CriUint64 Uint64; /* ȂWoCg */ +#endif + +#if !defined(_TYPEDEF_Sint64) +#define _TYPEDEF_Sint64 +typedef CriSint64 Sint64; /* ‚WoCg */ +#endif + +#if !defined(_TYPEDEF_Uint128) +#define _TYPEDEF_Uint128 +typedef CriUint128 Uint128; /* Ȃ16oCg */ +#endif + +#if !defined(_TYPEDEF_Sint128) +#define _TYPEDEF_Sint128 +typedef CriSint128 Sint128; /* ‚16oCg */ +#endif + +#if !defined(_TYPEDEF_Float16) +#define _TYPEDEF_Float16 +typedef CriFloat16 Float16; /* QoCg */ +#endif + +#if !defined(_TYPEDEF_Float32) +#define _TYPEDEF_Float32 +typedef CriFloat32 Float32; /* SoCg */ +#endif + +#if !defined(_TYPEDEF_Float64) +#define _TYPEDEF_Float64 +typedef CriFloat64 Float64; /* WoCg */ +#endif + +#if !defined(_TYPEDEF_Fixed32) +#define _TYPEDEF_Fixed32 +typedef CriFixed32 Fixed32; /* Œ菬_32rbg */ +#endif + +/* X11 APIixtrapproto.hjƂ̋p */ +#if !defined(_TYPEDEF_Bool) && !defined(Bool) +#define _TYPEDEF_Bool +typedef CriBool Bool; /* _^i_萔lɂƂj */ +#endif + +#if !defined(_TYPEDEF_Char8) +#define _TYPEDEF_Char8 +typedef CriChar8 Char8; /* ^ */ +#endif + +#if !defined(_TYPEDEF_SintPtr) +#define _TYPEDEF_SintPtr +typedef CriSintPtr SintPtr; +#endif + +#if !defined(_TYPEDEF_UintPtr) +#define _TYPEDEF_UintPtr +typedef CriUintPtr UintPtr; +#endif + +#endif /* CRI_XPT_DISABLE_UNPREFIXED_TYPE */ + +#endif /* CRI_INCL_CRI_XPT_POST_H */ + +/* end of file */ diff --git a/3rdParty/cri/orbis/include/cri_xpts_orbis.h b/3rdParty/cri/orbis/include/cri_xpts_orbis.h new file mode 100644 index 00000000..71aee5fd --- /dev/null +++ b/3rdParty/cri/orbis/include/cri_xpts_orbis.h @@ -0,0 +1,133 @@ +/**************************************************************************** + * + * CRI Middleware SDK + * + * Copyright (c) 1998-2012 CRI Middleware Co., Ltd. + * + * Library : CRI Middleware Library + * Module : CRI Common Header for PS4 + * File : cri_xpts_ps4.h + * Date : 2012-10-04 + * Version : 2.01 + * + ****************************************************************************/ + +#if !defined(CRI_INCL_CRI_XPTS_PS4_H) +#define CRI_INCL_CRI_XPTS_PS4_H + +/***************************************************************************** + * {f[^^錾 + *****************************************************************************/ + +#if !defined(_TYPEDEF_CriUint8) +#define _TYPEDEF_CriUint8 +typedef unsigned char CriUint8; /* ȂPoCg */ +#endif + +#if !defined(_TYPEDEF_CriSint8) +#define _TYPEDEF_CriSint8 +typedef signed char CriSint8; /* ‚PoCg */ +#endif + +#if !defined(_TYPEDEF_CriUint16) +#define _TYPEDEF_CriUint16 +typedef unsigned short CriUint16; /* ȂQoCg */ +#endif + +#if !defined(_TYPEDEF_CriSint16) +#define _TYPEDEF_CriSint16 +typedef signed short CriSint16; /* ‚QoCg */ +#endif + +#if !defined(_TYPEDEF_CriUint32) +#define _TYPEDEF_CriUint32 +typedef unsigned int CriUint32; /* ȂSoCg */ +#endif + +#if !defined(_TYPEDEF_CriSint32) +#define _TYPEDEF_CriSint32 +typedef signed int CriSint32; /* ‚SoCg */ +#endif + +#if !defined(_TYPEDEF_CriUint64) +#define _TYPEDEF_CriUint64 +typedef unsigned long CriUint64; /* ȂWoCg */ +#endif + +#if !defined(_TYPEDEF_CriSint64) +#define _TYPEDEF_CriSint64 +typedef signed long CriSint64; /* ‚WoCg */ +#endif + +#if !defined(_TYPEDEF_CriUint128) +#define _TYPEDEF_CriUint128 +//typedef unsigned __int128 CriUint128; /* Ȃ16oCg */ +typedef struct { /* Ȃ16oCg */ + CriUint64 h; /* 64rbg */ + CriUint64 l; /* 64rbg */ +} CriUint128; +#endif + +#if !defined(_TYPEDEF_CriSint128) +#define _TYPEDEF_CriSint128 +//typedef signed __int128 CriSint128; /* ‚16oCg */ +typedef struct { /* ‚16oCg */ + CriSint64 h; /* 64rbg */ + CriUint64 l; /* 64rbg */ +} CriSint128; +#endif + +#if !defined(_TYPEDEF_CriFloat16) +#define _TYPEDEF_CriFloat16 +typedef signed short CriFloat16; /* QoCg */ +#endif + +#if !defined(_TYPEDEF_CriFloat32) +#define _TYPEDEF_CriFloat32 +typedef float CriFloat32; /* SoCg */ +#endif + +#if !defined(_TYPEDEF_CriFloat64) +#define _TYPEDEF_CriFloat64 +typedef double CriFloat64; /* WoCg */ +#endif + +#if !defined(_TYPEDEF_CriFixed32) +#define _TYPEDEF_CriFixed32 +typedef signed int CriFixed32; /* Œ菬_32rbg */ +#endif + +#if !defined(_TYPEDEF_CriBool) +#define _TYPEDEF_CriBool +typedef CriSint32 CriBool; /* _^i_萔lɂƂj */ +#endif + +#if !defined(_TYPEDEF_CriChar8) +#define _TYPEDEF_CriChar8 +typedef char CriChar8; /* ^ */ +#endif + +/***************************************************************************** + * |C^i[”\Ȑ^ + *****************************************************************************/ +#if !defined(_TYPEDEF_CriSintPtr) +#define _TYPEDEF_CriSintPtr +typedef signed long CriSintPtr; // 8 bytes pointer +#endif + +#if !defined(_TYPEDEF_CriUintPtr) +#define _TYPEDEF_CriUintPtr +typedef unsigned long CriUintPtr; // 8 bytes pointer +#endif + +/***************************************************************************** + * ĂяoK + *****************************************************************************/ + +#if !defined(CRIAPI) +#define CRIAPI +#endif + +#endif /* CRI_INCL_CRI_XPTS_PS4_H */ + +/* end of file */ diff --git a/3rdParty/cri/pc/include/cri_allocator.h b/3rdParty/cri/pc/include/cri_allocator.h new file mode 100644 index 00000000..e3c18997 --- /dev/null +++ b/3rdParty/cri/pc/include/cri_allocator.h @@ -0,0 +1,63 @@ +#ifndef _CRI_ALLOCATOR_H_INCLUDED +#define _CRI_ALLOCATOR_H_INCLUDED +/**************************************************************************** + * * + * CRI Allocator * + * * + * 2006-01-05 written by M.Oshimi * + * * + ****************************************************************************/ + +/**************************************************************************** + * Include file + ****************************************************************************/ +#include +#include "cri_xpt.h" +#include "cri_heap.h" + +/**************************************************************************** + * Macro Constants + ****************************************************************************/ +#if defined(XPT_UNSUPPORT_CPLUSPLUS_THROW) +#define CRI_ALLOCATOR_CPLUSPLUS_THROW +#else +#define CRI_ALLOCATOR_CPLUSPLUS_THROW throw() +#endif + +/**************************************************************************** + * Class Declaration + ****************************************************************************/ +#ifdef __cplusplus + +class CriAllocator +{ +public: + static const CriSint32 DEFAULT_ALIGNMENT = CRIHEAP_DEFAULT_MEM_ALIGN; + + + static void* CRIAPI operator new(size_t size, CriHeap heap) CRI_ALLOCATOR_CPLUSPLUS_THROW; + static void* CRIAPI operator new(size_t size, CriHeap heap, CriHeapType heap_type) CRI_ALLOCATOR_CPLUSPLUS_THROW; + static void* CRIAPI operator new(size_t size, CriHeap heap, const CriChar8 *name, CriUint32 align=DEFAULT_ALIGNMENT) CRI_ALLOCATOR_CPLUSPLUS_THROW; + static void* CRIAPI operator new(size_t size, CriHeap heap, CriHeapType heap_type, const CriChar8 *name, CriUint32 align=DEFAULT_ALIGNMENT) CRI_ALLOCATOR_CPLUSPLUS_THROW; + + static void CRIAPI operator delete(void *p, size_t size); + + static void* CRIAPI operator new(size_t size, void *work, CriSint32 wksize) CRI_ALLOCATOR_CPLUSPLUS_THROW; + static void CRIAPI operator delete(void *p, void *work, CriSint32 wksize) CRI_ALLOCATOR_CPLUSPLUS_THROW; + static void* CRIAPI operator new(size_t size, void *work, CriSint32 wksize, CriUint32 align) CRI_ALLOCATOR_CPLUSPLUS_THROW; + static void CRIAPI operator delete(void *p, void *work, CriSint32 wksize, CriUint32 align) CRI_ALLOCATOR_CPLUSPLUS_THROW; + +#if !defined(XPT_TGT_BCB) + static void CRIAPI operator delete(void *p, CriHeap heap) CRI_ALLOCATOR_CPLUSPLUS_THROW; + static void CRIAPI operator delete(void *p, CriHeap heap, CriHeapType heap_type) CRI_ALLOCATOR_CPLUSPLUS_THROW; + static void CRIAPI operator delete(void *p, CriHeap heap, const CriChar8 *name, CriUint32 align) CRI_ALLOCATOR_CPLUSPLUS_THROW; + static void CRIAPI operator delete(void *p, CriHeap heap, CriHeapType heap_type, const CriChar8 *name, CriUint32 align) CRI_ALLOCATOR_CPLUSPLUS_THROW; +#endif + + static CriSint32 GetWorstExtraSize(CriUint32 align); +}; +#endif // _CRI_ALLOCATOR_H_INCLUDED + +#endif /* end of __cplusplus */ + +/* --- end of file --- */ diff --git a/3rdParty/cri/pc/include/cri_error.h b/3rdParty/cri/pc/include/cri_error.h new file mode 100644 index 00000000..ea913979 --- /dev/null +++ b/3rdParty/cri/pc/include/cri_error.h @@ -0,0 +1,368 @@ +#ifndef _CRI_ERROR_H_INCLUDED +#define _CRI_ERROR_H_INCLUDED +/**************************************************************************** + * + * CRI Middleware SDK + * + * Copyright (c) 2006-2009 CRI Middleware Co., Ltd. + * + * Library : CRI Error + * Module : + * File : cri_error.h + * + ****************************************************************************/ +/*! + * \file cri_error.h + */ +/*JP + * \addtogroup CRI_ERROR エラーハンドリング用関数群 + * @{ + */ +/*EN + * \addtogroup CRI_ERROR Functions for error handling + * @{ + */ + +/**************************************************************************** + * Include file * + ****************************************************************************/ +#include "cri_xpt.h" + +/**************************************************************************** + * MACRO CONSTANT * + ****************************************************************************/ + +/* バージョン番号 */ +/* Version number */ +#define CRIERROR_VER_NAME "CRI Error" +#define CRIERROR_VER_NUM "1.04.00" +#define CRIERROR_VER_OPTION + +/*JP + * \brief エラーコード + */ +/*EN + * \brief Error codes + */ +typedef enum { + CRIERR_OK = 0, /*JP< 正常終了 */ + /*EN< Succeeded */ + CRIERR_NG = -1, /*JP< エラーが発生 */ + /*EN< Error occurred */ + CRIERR_INVALID_PARAMETER = -2, /*JP< 引数が不正 */ + /*EN< Invalid argument */ + CRIERR_FAILED_TO_ALLOCATE_MEMORY = -3, /*JP< メモリの確保に失敗 */ + /*EN< Failed to allocate memory */ + CRIERR_UNSAFE_FUNCTION_CALL = -4, /*JP< 非スレッドセーフ関数の並列実行 */ + /*EN< Parallel execution of thread-unsafe function */ + CRIERR_FUNCTION_NOT_IMPLEMENTED = -5, /*JP< 未実装関数の実行 */ + /*EN< Function not implemented */ + CRIERR_LIBRARY_NOT_INITIALIZED = -6, /*JP< ライブラリが未初期化 */ + /*EN< Library not initialized */ + /* enum be 4bytes */ + CRIERR_ENUM_BE_SINT32 = 0x7FFFFFFF +} CriError; + +/*JP + * \brief エラー通知レベル + */ +/*EN + * \brief Error notification level + */ +typedef enum { + CRIERR_NOTIFY_ALL = 0, /*JP< 全てのエラーを通知 */ + /*EN< Notify all errors */ + CRIERR_NOTIFY_FATAL = 1, /*JP< エラーのみ通知(警告は無視) */ + /*EN< Notify error (Disregards warning) */ + /* enum be 4bytes */ + CRIERR_NOTIFY_ENUM_BE_SINT32 = 0x7FFFFFFF +} CriErrorNotificationLevel; + +/* エラーレベル */ +/* Error level */ +typedef enum { + CRIERR_LEVEL_ERROR = 0, + CRIERR_LEVEL_WARNING = 1, + /* enum be 4bytes */ + CRIERR_LEVEL_ENUM_BE_SINT32 = 0x7FFFFFFF +} CriErrorLevel; + +/**************************************************************************** + * PROCESS MACRO * + ****************************************************************************/ + +#if defined(CRIERROR_SIMPLIFY) + /* エラーの通知 */ + /* Notification of Error */ + #define criErr_NotifyError(id, msg) criErr_NotifyErrorSimple() + #define criErr_NotifyError1(id, msg, p1) criErr_NotifyErrorSimple() + #define criErr_NotifyError2(id, msg, p1, p2) criErr_NotifyErrorSimple() + #define criErr_NotifyErrorPrmArray(id, msg, p1, p2, pa) criErr_NotifyErrorSimple() + #define criErr_NotifyErrorGeneric(_error_id, _error_no) criErr_NotifyErrorSimple() + /* 警告の通知 */ + /* Notification of Warning */ + #define criErr_NotifyWarning(id, msg) criErr_NotifyWarningSimple() + #define criErr_NotifyWarning1(id, msg, p1) criErr_NotifyWarningSimple() + #define criErr_NotifyWarning2(id, msg, p1, p2) criErr_NotifyWarningSimple() + #define criErr_NotifyWarningPrmArray(id, msg, p1, p2, pa) criErr_NotifyWarningSimple() + #define criErr_NotifyWarningGeneric(_error_id, _error_no) criErr_NotifyWarningSimple() +#else + /* エラーの通知 */ + /* Notification of Error */ + #define criErr_NotifyError(id, msg) criErr_Notify(CRIERR_LEVEL_ERROR, id ":" msg) + #define criErr_NotifyError1(id, msg, p1) criErr_Notify1(CRIERR_LEVEL_ERROR, (id ":" msg), (CriUintPtr)(p1)) + #define criErr_NotifyError2(id, msg, p1, p2) criErr_Notify2(CRIERR_LEVEL_ERROR, (id ":" msg), (CriUintPtr)(p1), (CriUintPtr)(p2)) + #define criErr_NotifyErrorPrmArray(id, msg, p1, p2, pa) criErr_NotifyPrmArray(CRIERR_LEVEL_ERROR, (id ":" msg), (CriUintPtr)(p1), (CriUintPtr)(p2), (CriUintPtr *)(pa)) + #define criErr_NotifyErrorGeneric(_error_id, _error_no) criErr_NotifyGeneric(CRIERR_LEVEL_ERROR, _error_id, _error_no) + /* 警告の通知 */ + /* Notification of Warning */ + #define criErr_NotifyWarning(id, msg) criErr_Notify(CRIERR_LEVEL_WARNING, id ":" msg) + #define criErr_NotifyWarning1(id, msg, p1) criErr_Notify1(CRIERR_LEVEL_WARNING, (id ":" msg), (CriUintPtr)(p1)) + #define criErr_NotifyWarning2(id, msg, p1, p2) criErr_Notify2(CRIERR_LEVEL_WARNING, (id ":" msg), (CriUintPtr)(p1), (CriUintPtr)(p2)) + #define criErr_NotifyWarningPrmArray(id, msg, p1, p2, pa) criErr_NotifyPrmArray(CRIERR_LEVEL_WARNING, (id ":" msg), (CriUintPtr)(p1), (CriUintPtr)(p2), (CriUintPtr *)(pa)) + #define criErr_NotifyWarningGeneric(_error_id, _error_no) criErr_NotifyGeneric(CRIERR_LEVEL_WARNING, _error_id, _error_no) +#endif + +/**************************************************************************** + * Data type declaration * + ****************************************************************************/ + +/* Error Callback Function type */ +typedef void (CRIAPI *CriErrCbFunc)(const CriChar8 *errid, CriUint32 p1, CriUint32 p2, CriUint32 *parray); + +/**************************************************************************** + * 変数の宣言 * + * Variable Declaration * + ****************************************************************************/ +/* エラー出力省略用変数 */ +/* default argument of CriError */ +#ifdef __cplusplus +namespace criErr { + extern CriError ErrorContainer; +} +#endif /* __cplusplus */ + +/**************************************************************************** + * 関数の宣言 * + * Function Declaration * + ****************************************************************************/ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +/*JP + * \brief エラーID文字列からエラーメッセージへ変換 + * \ingroup CRI_ERROR + * \param[in] errid エラーID文字列 + * \return エラーメッセージ + * \par 説明: + * エラーID文字列から詳細なエラーメッセージへ変換します。
+ * \attention + * この関数は旧仕様の関数です。
+ * 代わりに ::criErr_ConvertIdToMessage 関数を使用してください。 + * \sa criErr_ConvertIdToMessage + */ +/*EN + * \brief Convert error ID to error message + * \ingroup CRI_ERROR + * \param[in] errid error ID + * \return error message + * \par Explanation: + * This function converts error ID to detailed error message.
+ * \attention + * This function is an obsolete one.
+ * Please use the ::criErr_ConvertIdToMessage function instead. + * \sa criErr_ConvertIdToMessage + */ +const CriChar8* CRIAPI criErr_ConvertIdToMsg(const CriChar8 *errid); + +/*JP + * \brief エラーID文字列からエラーメッセージへ変換 + * \ingroup CRI_ERROR + * \param[in] errid エラーID文字列 + * \param[in] p1 補足情報1 + * \param[in] p2 補足情報2 + * \return エラーメッセージ + * \par 説明: + * エラーID文字列から詳細なエラーメッセージへ変換します。
+ * \par 用例: + * \code + * void user_error_callback_func(const CriChar8 *errid, CriUint32 p1, CriUint32 p2, CriUint32 *parray); + * { + * const CriChar8 *errmsg; + * errmsg = criErr_ConvertIdToMessage(errid, p1, p2); + * printf("%s\n", errmsg); + * } + * \endcode + */ +/*EN + * \brief Convert error ID to error message + * \ingroup CRI_ERROR + * \param[in] errid error ID + * \param[in] p1 supplementary information 1 + * \param[in] p2 supplementary information 2 + * \return error message + * \par Explanation: + * This function converts error ID to detailed error message.
+ * \par Example: + * \code + * void user_error_callback_func(const CriChar8 *errid, CriUint32 p1, CriUint32 p2, CriUint32 *parray); + * { + * const CriChar8 *errmsg; + * errmsg = criErr_ConvertIdToMessage(errid, p1, p2); + * printf("%s\n", errmsg); + * } + * \endcode + */ +const CriChar8* CRIAPI criErr_ConvertIdToMessage(const CriChar8 *errid, CriUint32 p1, CriUint32 p2); + +/*JP + * \brief エラーコールバック関数の登録 + * \ingroup CRI_ERROR + * \param[in] cbf エラーコールバック関数 + * \return なし + * \par 説明: + * エラーコールバック関数を登録します。
+ * 登録された関数は、CRIミドルウエアライブラリ内でエラーが発生したときに呼び出されます。
+ * 同時に登録できるエラーコールバック関数は1つです。
+ * 登録後に再度本関数を呼び出した場合は現在の登録を上書きします。 + * \par 用例: + * \code + * void user_error_callback_func(const CriChar8 *errid, CriUint32 p1, CriUint32 p2, CriUint32 *parray); + * { + * const CriChar8 *errmsg; + * errmsg = criErr_ConvertIdToMessage(errid, p1, p2); + * printf("%s\n", errmsg); + * } + * + * void main(int ac, char *av[]) + * { + * : + * // エラーコールバックの登録 + * criErr_SetCallback(user_error_callback_func); + * : + * } + * \endcode + */ +/*EN + * \brief Register error callback function + * \ingroup CRI_ERROR + * \param[in] cbf error callback function + * \return NONE + * \par Explanation: + * This function registers an error callback function.
+ * The registered function is called if an error occurs within the CRI middleware library. + * \par Example: + * \code + * void user_error_callback_func(const CriChar8 *errid, CriUint32 p1, CriUint32 p2, CriUint32 *parray); + * { + * const CriChar8 *errmsg; + * errmsg = criErr_ConvertIdToMessage(errid, p1, p2); + * printf("%s\n", errmsg); + * } + * + * void main(int ac, char *av[]) + * { + * : + * // Registers the error callback function + * criErr_SetCallback(user_error_callback_func); + * : + * } + * \endcode + */ +void CRIAPI criErr_SetCallback(CriErrCbFunc cbf); + +/*JP + * \brief エラー通知レベルの変更 + * \ingroup CRI_ERROR + * \param[in] level エラー通知レベル + * \return なし + * \par 説明: + * エラーコールバックに通知するエラーのレベルを変更します。 + */ +/*EN + * \brief Change error notification level + * \ingroup CRI_ERROR + * \param[in] level error notification level + * \return NONE + * \par Explanation: + * This function changes the level of error information that is notified to the error callback. + */ +void CRIAPI criErr_SetErrorNotificationLevel(CriErrorNotificationLevel level); + +/*JP + * \brief エラー発生回数の取得 + * \ingroup CRI_ERROR + * \param[in] level エラーレベル + * \return エラー発生回数 + * \par 説明: + * エラー発生回数を取得します。 + */ +/*EN + * \brief Retrieve error count + * \ingroup CRI_ERROR + * \param[in] level error level + * \return number of errors occured + * \par Explanation: + * This function retrieves the number of errors occured. + */ +CriUint32 CRIAPI criErr_GetErrorCount(CriErrorLevel level); + +/*JP + * \brief エラー発生回数のリセット + * \ingroup CRI_ERROR + * \param[in] level エラーレベル + * \return なし + * \par 説明: + * エラー発生回数のカウンタを0に戻します。 + */ +/*EN + * \brief Resets error count + * \ingroup CRI_ERROR + * \param[in] level error level + * \return NONE + * \par Explanation: + * This function resets the counter for number of errors occured. + */ +void CRIAPI criErr_ResetErrorCount(CriErrorLevel level); + +/* エラーコールバックを発生させる (内部関数) */ +/* Error notification (Internal functions) */ +void CRIAPI criErr_Notify(CriErrorLevel level, const CriChar8 *errid); +void CRIAPI criErr_Notify1(CriErrorLevel level, const CriChar8 *errid, CriUintPtr p1); +void CRIAPI criErr_Notify2(CriErrorLevel level, const CriChar8 *errid, CriUintPtr p1, CriUintPtr p2); +void CRIAPI criErr_NotifyPrmArray(CriErrorLevel level, const CriChar8 *errid, CriUintPtr p1, CriUintPtr p2, CriUintPtr *pa); +void CRIAPI criErr_NotifyGeneric(CriErrorLevel level, const CriChar8 *error_id, CriError error_no); +void CRIAPI criErr_NotifyErrorSimple(void); +void CRIAPI criErr_NotifyWarningSimple(void); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +/*************************************************************************** + * 旧バージョンとの互換用 + * For compatibility with old versions + ***************************************************************************/ +#define criErr_Invoke(errid) criErr_Notify(CRIERR_LEVEL_ERROR, errid) +#define criErr_Invoke1(errid, p1) criErr_Notify1(CRIERR_LEVEL_ERROR, errid, p1) +#define criErr_Invoke2(errid, p1, p2) criErr_Notify2(CRIERR_LEVEL_ERROR, errid, p1, p2) +#define criErr_InvokePrmArray(errid, p1, p2, pa) criErr_NotifyPrmArray(CRIERR_LEVEL_ERROR, errid, p1, p2, pa) +#define criErr_InvokeGeneric(error_id, error_no) criErr_NotifyGeneric(CRIERR_LEVEL_ERROR, error_id, error_no) +#define criErr_Occur(id, msg) criErr_Notify(CRIERR_LEVEL_ERROR, id ":" msg) +#define criErr_Occur1(id, msg, p1) criErr_Notify1(CRIERR_LEVEL_ERROR, (id ":" msg), (CriUintPtr)(p1)) +#define criErr_Occur2(id, msg, p1, p2) criErr_Notify2(CRIERR_LEVEL_ERROR, (id ":" msg), (CriUintPtr)(p1), (CriUintPtr)(p2)) +#define criErr_OccurPrmArray(id, msg, p1, p2, pa) criErr_NotifyPrmArray(CRIERR_LEVEL_ERROR, (id ":" msg), (CriUintPtr)(p1), (CriUintPtr)(p2), (CriUintPtr*)(pa)) +#define criErr_OccurGeneric(_error_id, _error_no) criErr_NotifyGeneric(CRIERR_LEVEL_ERROR, _error_id, _error_no) + +/*EN + * @} + */ +/*JP + * @} + */ + +#endif // _CRI_ERROR_H_INCLUDED + +/* --- end of file --- */ diff --git a/3rdParty/cri/pc/include/cri_heap.h b/3rdParty/cri/pc/include/cri_heap.h new file mode 100644 index 00000000..18ec11c2 --- /dev/null +++ b/3rdParty/cri/pc/include/cri_heap.h @@ -0,0 +1,640 @@ +#ifndef _CRI_HEAP_H_INCLUDED +#define _CRI_HEAP_H_INCLUDED +/**************************************************************************** + * * + * CRI Heap Manager "CriHeap" Library * + * * + * 2005-03-17 written by satouo * + * * + ****************************************************************************/ +/*! + * \file cri_heap.h + */ + +/**************************************************************************** + * インクルードファイル * + * Include file * + ****************************************************************************/ +#include "cri_xpt.h" + +#ifdef XPT_TGT_PC +#pragma pack(push) +#pragma pack(1) //The boundary value of structure is adjusted to 1 byte. +#endif + +/**************************************************************************** + * 定数マクロ * + * MACRO CONSTANT * + ****************************************************************************/ +/* Version number of CRIHEAP */ +#define CRIHEAP_NAME_STRINGS "CRI Heap" +#define CRIHEAP_VERSION_STRINGS "1.21.02" + +/* Default memory alignment */ +#define CRIHEAP_DEFAULT_MEM_ALIGN (8) + +/**************************************************************************** + * 列挙定数マクロ * + * ENUM CONSTANT * + ****************************************************************************/ +/*JP + * \brief メモリのタイプ + */ +/*EN + * \brief Types of heap + */ +typedef enum { + CRIHEAP_TYPE_FIX = (1), + CRIHEAP_TYPE_TEMPORARY = (2), + CRIHEAP_TYPE_DYNAMIC = (3), // unuse + CRIHEAP_TYPE_NONE = (0), + /* enum be 4bytes */ + CRIHEAP_TYPE_ENUM_BE_SINT32 = 0x7FFFFFFF +} CriHeapType; + +/**************************************************************************** + * データ型 * + * Data type declaration * + ****************************************************************************/ +/* CriHeapハンドル */ +/* CriHeap handle */ +#ifndef CRIHEAP_DEFINED +#define CRIHEAP_DEFINED + +/* internal */ +typedef struct CriHeapBlockTag { + struct CriHeapBlockTag *prevblock; + struct CriHeapBlockTag *nextblock; + CriSint32 memsize; + CriUint8 used; + CriUint8 type; + CriUint16 alignspc; + CriUint16 gap; + CriChar8 *nameadr; +} CriHeapBlock, *CriHeapBlockPtr; + +/*JP + * \brief CRI Heapハンドル + * \struct CriHeap + * \ingroup CRIHEAP_BASIC + * CRI Heapを用いてメモリアロケートを行うために必要なハンドルです。
+ * このハンドルに対して、メモリアロケートやメモリフリーを行います。 + * \sa criHeap_Create(), criHeap_Destroy() + */ +/*EN + * \brief CRI Heap handle + * \struct CriHeap + * \ingroup CRIHEAP_BASIC + * \par Description: + * The heap handle. This data structure needs to exist through the life cycle of + * the heap. It allows the library to allocate and deallocate memory + * internally within the heap. Typically this handle gets allocated at the + * beginning of the heap memory that you've provided for the heap, but don't + * depend on this behavior. The heap itself is opaque. You can of course + * allocate multiple non-contiguous heaps, but these will be separate heap + * structures and a single allocation won't choose between them. + * + * \sa criHeap_Create(), criHeap_Destroy() + */ +typedef struct _criheap_struct { + struct _criheap_vfunctiontable *vtbl; + CriSint32 totalsize; + CriSint32 peaksize; + CriSint32 currentsize; + CriHeapBlock *topblock; + CriHeapBlock *taleblock; +} CriHeapObj, *CriHeap; + +/*JP + * \brief CRI Heap仮想関数テーブル + * \struct criHeapVirtualFunctionTable + * \ingroup CRIHEAP_BASIC + * 独自のメモリアロケート関数を実装する際に使用する仮想関数テーブル構造体です。
+ * 各関数はマルチスレッドセーフである必要があります。
+ * \par 備考: + * 3番目のアロケート関数は現在未使用です。 + */ +/*EN + * \brief CRI Heap Virtual Function Table + * \struct criHeapVirtualFunctionTable + * \ingroup CRIHEAP_BASIC + * \par Description: + * The virtual functions table for original allocation functions.
+ * The third allocation function is not in use currently. + */ +typedef struct _criheap_vfunctiontable { + /*JP + * \brief メモリのアロケート(メモリ領域の先端から) + * \par 説明: + * criHeap_AllocFix関数呼び出し時に呼ばれます。 + * \sa criHeap_AllocFix() + */ + /*EN + * \brief Memory allocation (allocating from the top of the memory area) + * \par Description: + * Called from criHeap_AllocFix(). + * \sa criHeap_AllocFix() + */ + void *(*AllocFix)(CriHeap heap, CriSint32 size, const CriChar8 *name, CriSint32 align); + /*JP + * \brief メモリのアロケート(メモリ領域の終端から) + * \par 説明: + * criHeap_AllocFix関数呼び出し時に呼ばれます。 + * \sa criHeap_AllocTemporary() + */ + /*EN + * \brief Memory allocation (allocating from the tail of the memory area) + * \par Description: + * Called from criHeap_AllocTemporary(). + * \sa criHeap_AllocTemporary() + */ + void *(*AllocTemporary)(CriHeap heap, CriSint32 size, const CriChar8 *name, CriSint32 align); + /*JP + * \brief 未使用関数 + */ + /*EN + * \brief Unused + */ + void *(*AllocDynamic)(CriHeap heap, CriSint32 size, const CriChar8 *name, CriSint32 align); // unused + + /*JP + * \brief メモリのフリー + * \par 説明: + * criHeap_Free関数呼び出し時に呼ばれます。 + * \sa criHeap_Free() + */ + /*EN + * \brief Memory deallocation + * \par Description: + * Called from criHeap_Free(). + * \sa criHeap_Free() + */ + CriSint32 (*Free)(CriHeap heap, void *ptr); +} criHeapVirtualFunctionTable; + +#endif + + +/**************************************************************************** + * 関数の宣言 + * Function Declaration + ****************************************************************************/ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +/*==========================================================================* + * ライブラリの初期化と終了処理 + * Initialize and Finalize of Library + *==========================================================================*/ +/*JP + * \brief CRI Heapライブラリの初期化 + * \ingroup CRIHEAP_BASIC + * \par 説明: + * CRI Heapライブラリを使用するために必要な初期化関数です。
+ * CRI Heapを使用する際はあらかじめ本関数をコールする必要があります。 + * \sa criHeap_Finalize() + */ +/*EN + * \brief Initialize the heap manager. + * \ingroup CRIHEAP_BASIC + * \par Description: + * This function initializes the heap manager and prepares it to manage heaps. + * This function only has an effect the first time it is called in your program. + * Subsequent calls only increment an internal counter. This allows your + * program to call criHeap_Initialize() in pairs with criHeap_Finalize() + * throughout your program modules, and only the initial call to criHeap_Initialize() + * and the final call to criHeap_Finalize() will have any effect. + * \if ps2 + * \par PS2 only: + * This function does a sanity check to make sure that the size of the CriHeapObj + * data structure is a factor of 16. If it is not a factor of 16, this function + * hangs. + * \endif + * \sa criHeap_Finalize() + */ +void CRIAPI criHeap_Initialize(void); + +/*JP + * \brief CRI Heapライブラリの終了 + * \ingroup CRIHEAP_BASIC + * \par 説明: + * CRI Heapライブラリを終了するために必要な終了関数です。
+ * CRI Heapの使用を終了する際は本関数をコールしてください。 + * \sa criHeap_Initialize() + */ +/*EN + * \brief Finalize the heap manager. + * \ingroup CRIHEAP_BASIC + * \par Description: + * This function finalizes the heap manager. If the criHeap_Initialize() function + * is called n times, then the nth time that criHeap_Finalize() + * is called, this function invalidates any heaps currently in use. Calling + * any heap function after the nth call to criHeap_Finalize() will + * have unpredictable results. + * \sa criHeap_Initialize() + */ +void CRIAPI criHeap_Finalize(void); + +/*==========================================================================* + * ハンドルの生成・解放 + *==========================================================================*/ +/*JP + * \brief CRI Heapハンドルの生成 + * \ingroup CRIHEAP_BASIC + * \param ptr メモリ領域のポインタ。 + * \param size メモリ領域のサイズ。 + * \return CRI Heapハンドル。
生成に失敗した場合は、NULLが返ります。 + * \par 説明: + * CRI Heapハンドルを生成します。
+ * 本関数で与えるメモリ領域は、CRI Heap自身のハンドル領域やアロケート時に + * 確保されるメモリ領域となります。
+ * 管理領域を含むため、メモリ領域すべてがアロケート出来ない点に注意してください。 + * 管理領域の目安は「1ハンドルあたりsizeof(CriHeapObj)」+「1アロケートあたり + * sizeof(CriHeapBlock)+各メモリアライメントに必要なサイズ」となります。 + * \code + * CriChar8 heap_buffer[0x2000]; + * CriHeap heap = criHeap_Create((void *)heap_buffer, sizeof(heap_buffer); + * \endcode + * \sa criHeap_Destroy() + */ +/*EN + * \brief Create a contiguous heap in memory. + * \ingroup CRIHEAP_BASIC + * \param ptr A pointer to the start of the memory region to use as a heap. + * \param size The size of the region to be used as a heap. + * \return A valid CriHeap handle if successful, or NULL if unsuccessful. + * \par Description: + * This function allows you to set aside a region of memory for this library's + * use as a "heap". Heap allocation is required before active playback + * can begin. + * This function will fail and return NULL if the size of the memory region + * is smaller than the CriHeapObj structure. + * \code + * CriChar8 heap_buffer[0x2000]; + * CriHeap heap = criHeap_Create((void *)heap_buffer, sizeof(heap_buffer); + * \endcode + * \sa criHeap_Destroy() + */ +CriHeap CRIAPI criHeap_Create(void *ptr, CriSint32 size); + +/*JP + * \brief 非スレッドセーフなCRI Heapハンドルの生成 + * \ingroup CRIHEAP_BASIC + * \param ptr メモリ領域のポインタ。 + * \param size メモリ領域のサイズ。 + * \return CRI Heapハンドル。
生成に失敗した場合は、NULLが返ります。 + * \par 説明: + * CRI Heapハンドルを生成します。
+ * 本関数を使用して作成されたヒープは、排他制御が行なわれません。
+ * 複数スレッドから同時に参照されるヒープの作成には、criHeap_Create関数をご利用ください。 + * \sa criHeap_Create(), criHeap_Destroy() + */ +/*EN + * \brief Create a contiguous heap in memory. + * \ingroup CRIHEAP_BASIC + * \param ptr A pointer to the start of the memory region to use as a heap. + * \param size The size of the region to be used as a heap. + * \return A valid CriHeap handle if successful, or NULL if unsuccessful. + * \par Description: + * This function creates a heap to use the static memory as dynamically allocatable memory. + * The heap created by using this function is not threadsafe. + * If heap will be accessed by multiple threads, you must create the heap by using the criHeap_Create function. + * \sa criHeap_Create(), criHeap_Destroy() + */ +CriHeap CRIAPI criHeap_CreateNoSerialize(void *ptr, CriSint32 size); + +/*JP + * \brief CRI Heapハンドルの解放 + * \ingroup CRIHEAP_BASIC + * \param heap CRI Heapハンドル。 + * \par 説明: + * CRI Heapハンドルを解放します。
criHeap_Create() で指定されたメモリ領域が + * 解放され、CRI Heapハンドルは無効となります。 + * \sa criHeap_Create() + */ +/*EN + * \brief Destroy a previously created heap. + * \ingroup CRIHEAP_BASIC + * \param heap A CriHeap handle previously created with criHeap_Create(). + * \par Description: + * This function frees all internal allocations previously performed on + * the heap and frees the memory. Internally, this function does in + * fact walk through the heap, finding and freeing all allocations, e.g. + * it is not stubbed. So calling this function on a trashed heap + * will have unpredictable results. + * \sa criHeap_Create() + */ +void CRIAPI criHeap_Destroy(CriHeap heap); + +/*==========================================================================* + * Allocation + *==========================================================================*/ +/*JP + * \brief メモリのアロケート(メモリ領域の先端から) + * \ingroup CRIHEAP_ALLOC + * \param heap CRI Heapハンドル。 + * \param size アロケートするメモリのサイズ。 + * \param name アロケートするメモリの名前。名前はデバッグ時に使用されます。 + * \param align アロケートするメモリのアライメント。 + * \return アロケートしたメモリへのポインタ。
アロケートに失敗した場合はNULLが返ります。 + * \par 説明: + * メモリ領域の先端側から確保するメモリアロケーション関数です。ヒープ領域内に\ref block_fix "Fixブロック"を作成します。
+ * メモリの断片化を防ぐため、同じサイズ/アライメントの解放済み\ref block_fix "Fixブロック"を先端側から探して、再利用するように試みます。それが見つからない場合は、未使用の空き領域(\ref block_free "Freeブロック")を分割してメモリを取得します。 + * \code + * CriChar8 heap_buffer[0x2000]; + * CriHeap heap = criHeap_Create((void *)heap_buffer, sizeof(heap_buffer); + * void *memptr = criHeap_AllocFix(heap, 0x100, "forTexture1", 64); + * \endcode + * \sa criHeap_AllocTemporary(), criHeap_Free() + */ +/*EN + * \brief Memory allocation (allocating from the top of the memory area) + * \ingroup CRIHEAP_ALLOC + * \param heap CRI Heap handle + * \param size Memory block size to be allocated + * \param name Memory block name, which is used on debugging + * \param align Memory block alignment + * \return A pointer to the allocated memory block.
Returns NULL if unsuccessful. + * \par Description: + * This function allocates a memory block from the top of the memory area and creates a \ref block_fix "Fix block" in the heap area.
+ * To prevent memory fragmentation, a released \ref block_fix "Fix block" with the same size and alignment is searched for in the heap area from the top to the bottom and tries to reused the block. And if not found, an unused free block (\ref block_free "Free block") is divided and a new block is allocated. + * \code + * CriChar8 heap_buffer[0x2000]; + * CriHeap heap = criHeap_Create((void *)heap_buffer, sizeof(heap_buffer); + * void *memptr = criHeap_AllocFix(heap, 0x100, "forTexture1", 64); + * \endcode + * \sa criHeap_AllocTemporary(), criHeap_Free() + */ +void * CRIAPI criHeap_AllocFix(CriHeap heap, CriSint32 size, const CriChar8 *name, CriSint32 align); + +/*JP + * \brief メモリのアロケート(メモリ領域の終端から) + * \ingroup CRIHEAP_ALLOC + * \param heap CRI Heapハンドル。 + * \param size アロケートするメモリのサイズ。 + * \param name アロケートするメモリの名前。名前はデバッグ時に使用されます。 + * \param align アロケートするメモリのアライメント。 + * \return アロケートしたメモリへのポインタ。
アロケートに失敗した場合はNULLが返ります。 + * \par 説明: + * メモリ領域の終端側から確保するメモリアロケーション関数です。ヒープ領域内に\ref block_temporary "Temporaryブロック"を作成します。
+ * 要求したサイズ/アライメントをアロケート可能な解放済み\ref block_temporary "Temporaryブロック"を終端側から探して、分割または再利用するように試みます。それが見つからない場合は、未使用の空き領域(\ref block_free "Freeブロック")を分割してメモリを取得します。
+ * ヒープ領域の終端側からメモリをアロケートするため、先端側での断片化を防ぐことが出来ます。
+ * 主に、一時的に利用するメモリに使用します。 + * \sa criHeap_AllocFix(), criHeap_Free() + */ +/*EN + * \brief Memory allocation (allocating from the tail of the memory area) + * \ingroup CRIHEAP_ALLOC + * \param heap CRI Heap handle + * \param size Memory block size to be allocated + * \param name Memory block name, which is used on debugging + * \param align Memory block alignment + * \return A pointer to the allocated memory block.
Returns NULL if unsuccessful. + * \par Description: + * This function allocates a memory block from the bottom of the memory area and creates a \ref block_temporary "Temporary block" in the heap area.
+ * A released \ref block_temporary "Temporary block" available with the requested size and alignment is searched for in the heap area from the bottom and tries to divide and to reuse the block. And if not found, an unused free block (\ref block_free "Free block") is divided and a new block is allocated.
+ * Allocating from the bottom of the heap area will prevent fragmentation in the top of the heap area.
+ * Temporary block is mainly used for the memory area that is temporarily used. + * \sa criHeap_AllocFix(), criHeap_Free() + */ +void * CRIAPI criHeap_AllocTemporary(CriHeap heap, CriSint32 size, const CriChar8 *name, CriSint32 align); + +/* DYNAMIC (unuse) */ +//void * CRIAPI criHeap_AllocDynamic(CriHeap heap, CriSint32 size, const CriChar8 *name, CriSint32 align); + +void * CRIAPI criHeap_Alloc(CriHeap heap, CriSint32 size, const CriChar8 *name, CriSint32 align, CriSint32 type); + +/*==========================================================================* + * Free + *==========================================================================*/ +/*JP + * \brief メモリのフリー + * \ingroup CRIHEAP_ALLOC + * \param heap CRI Heapハンドル。 + * \param ptr アロケートしたメモリのポインタ。 + * \return フリーされたメモリサイズ。 + * \par 説明: + * アロケートされたメモリをフリーします。
+ * \code + * void *memptr = criHeap_AllocFix(heap, 0x100, "forTexture1", 64); + * criHeap_Free(heap, memptr); + * \endcode + * \sa criHeap_AllocFix(), criHeap_AllocTemporary() + */ +/*EN + * \brief Memory deallocation + * \ingroup CRIHEAP_ALLOC + * \param heap CRI Heap handle + * \param ptr The pointer to the allocated memory block + * \return Deallocated memory block size + * \par Description: + * This function deallocates the allocated memory block.
+ * \code + * void *memptr = criHeap_AllocFix(heap, 0x100, "forTexture1", 64); + * criHeap_Free(heap, memptr); + * \endcode + * \sa criHeap_AllocFix(), criHeap_AllocTemporary() + */ +CriSint32 CRIAPI criHeap_Free(CriHeap heap, void *ptr); + +/*==========================================================================* + * 排他制御用関数 + *==========================================================================*/ +CriSint32 CRIAPI criHeap_EnterCriticalSection(void); +CriSint32 CRIAPI criHeap_LeaveCriticalSection(void); + +/*==========================================================================* + * その他の関数 + *==========================================================================*/ +/* For only internal use */ +CriSint32 CRIAPI criHeap_SwitchAllocFunctions(CriHeap heap); + +/*==========================================================================* + * デバッグ関連 + *==========================================================================*/ +/*JP + * \brief ピークメモリサイズの取得 + * \ingroup CRIHEAP_DEBUG + * \param heap CRI Heapハンドル。 + * \return 使用されたメモリの最大値。 + * \par 説明: + * 過去、使用されたメモリ量の最大値を返します。
+ * 最大値はcriHeap_DebugResetPeakMemorySize() でリセットすることが出来ます。 + * \sa criHeap_DebugResetPeakMemorySize() + */ +/*EN + * \brief Returns peak memory usage of the heap. + * \ingroup CRIHEAP_DEBUG + * \param heap The heap previously allocated by criHeap_Create(). + * \return The maximum number of bytes used by the heap. + * \par Description: + * The amount of memory used by these libraries is variable and depends + * on the number of simultaneous streams being read, the seek and error + * frequency within the stream being read, video resolution and other + * factors. This function allows you to tune the allocation of the heap + * to achieve a required performance level while allocating minimal + * heap space for this library. To get accurate readings, this function + * should typically be called just before criHeap_Destroy(), and after + * exercising all the video and audio functions in your program. + */ +CriSint32 CRIAPI criHeap_DebugGetPeakMemorySize(CriHeap heap); + +/*JP + * \brief ピークメモリサイズのリセット + * \ingroup CRIHEAP_DEBUG + * \param heap CRI Heapハンドル。 + * \par 説明: + * ピークメモリサイズをリセットします。 + * \sa criHeap_DebugGetPeakMemorySize() + */ +/*EN + * \brief Reset peak memory size + * \ingroup CRIHEAP_DEBUG + * \param heap CRI Heap handle + * \par Description: + * The peak memory size is reset. + * \sa criHeap_DebugGetPeakMemorySize() + */ +void CRIAPI criHeap_DebugResetPeakMemorySize(CriHeap heap); + +/*JP + * \brief メモリブロック数の取得 + * \ingroup CRIHEAP_DEBUG + * \param heap CRI Heapハンドル。 + * \return メモリブロック数。 + * \par 説明: + * アロケートされたメモリのブロック数を返します。
+ * CRI Heapハンドル生成直後は未使用のメモリブロックが1つ存在する状態 + * となります。また、フリーされた断片化されたメモリブロックもこの数に + * 含みます。 + * \sa criHeap_DebugGetUsedBlocks() + */ +/*EN + * \brief Get number of allocated memory blocks + * \ingroup CRIHEAP_DEBUG + * \param heap CRI Heap handle + * \return Number of allocated memory blocks + * \par Description: + * The number of allocated memory blocks is returned.
+ * One unused memory block exists right after CRI Heap handle creation. + * The number of released fragmented memory blocks is also included. + * \sa criHeap_DebugGetUsedBlocks() + */ + CriSint32 CRIAPI criHeap_DebugGetNumBlocks(CriHeap heap); + +/*JP + * \brief 使用メモリブロック数の取得 + * \ingroup CRIHEAP_DEBUG + * \param heap CRI Heapハンドル。 + * \return 使用メモリブロック数。 + * \par 説明: + * アロケートされているメモリブロックの数を返します。 + * \sa criHeap_DebugGetNumBlocks() + */ +/*EN + * \brief Get number of used memory blocks + * \ingroup CRIHEAP_DEBUG + * \param heap CRI Heap + * \return Number of used memory blocks + * \par Description: + * The number of used memory blocks is returned.
+ * \sa criHeap_DebugGetNumBlocks() + */ +CriSint32 CRIAPI criHeap_DebugGetUsedBlocks(CriHeap heap); + +/*JP + * \brief メモリブロック名の取得 + * \ingroup CRIHEAP_DEBUG + * \param heap CRI Heapハンドル。 + * \param ptr アロケートしたメモリのポインタ。 + * \return メモリブロック名。 + * \par 説明: + * アロケート時に設定したメモリブロック名へのポインタを返します。
+ */ +/*EN + * \brief Get memory block name + * \ingroup CRIHEAP_DEBUG + * \param heap CRI Heap + * \param ptr A pointer to the allocated memory block + * \return Memory block name + * \par Description: + * The pointer to the memory block name specified on allocation is returned.
+ */ +CriChar8 * CRIAPI criHeap_DebugGetBlockName(CriHeap heap, void *ptr); + +/* メモリブロック番号の取得 */ +//CriSint32 CRIAPI criHeap_DebugGetBlockNumberFromPointer(CriHeap heap, void *ptr); + +/* メモリブロック情報の取得 */ +//void CRIAPI criHeap_DebugGetBlockInformation(CriHeap heap, +// CriSint32 blocknumber, CriHeapBlock *heapblock); + +/* メモリブロック情報の表示 */ +//void CRIAPI criHeap_DebugPrintBlockInformation(CriHeap heap, +// CriSint32 blocknumber, CriHeapBlock *heapblock); + +/*JP + * \brief メモリブロック情報の表示 + * \ingroup CRIHEAP_DEBUG + * \param heap CRI Heapハンドル。 + * \par 説明: + * 現在のメモリブロック情報を表示します。
+ * printf関数などの標準出力に表示を行います。 + */ +/*EN + * \brief Print memory block information + * \ingroup CRIHEAP_DEBUG + * \param heap CRI Heap + * \par Description: + * The current memory block information is displayed.
+ * It is displayed on the standard output for the printf function. + */ + void CRIAPI criHeap_DebugPrintBlockInformationAll(CriHeap heap); + +/*JP + * \brief メモリアロケートサイズの取得 + * \ingroup CRIHEAP_DEBUG + * \param heap CRI Heapハンドル。 + * \par 説明: + * 現在のメモリアロケートサイズの合計値を返します。 + */ +/*EN + * \brief Get total allocation size + * \ingroup CRIHEAP_DEBUG + * \param heap CRI Heap + * \par Description: + * The total size of allocated memory blocks is returned. + */ +CriSint32 CRIAPI criHeap_DebugGetTotalAllocSize(CriHeap heap); + +/* フリーサイズの取得 */ +//CriSint32 CRIAPI criHeap_DebugGetTotalFreeSize(CriHeap heap); + +/* メモリアロケートサイズの取得(タイプ別) */ +CriSint32 CRIAPI criHeap_DebugGetAllocSize(CriHeap heap, CriSint32 type); + +/* ヒープヘッダサイズの取得 */ +CriSint64 CRIAPI criHeap_DebugGetHandleHeaderSize(CriHeap heap); + +/* メモリブロックヘッダサイズの取得 ptr: Allocated Pointer */ +CriSint64 CRIAPI criHeap_DebugGetMemBlockHeaderSize(void *ptr); + +/* 追加で必要となるサイズの最大値 */ +CriSint32 CRIAPI criHeap_DebugGetWorstExtraSize(CriSint32 alignment); + +/* criHeap_AllocFixでアロケート可能なサイズ */ +CriSint32 CRIAPI criHeap_DebugGetFixAllocatableSize(CriHeap heap, CriSint32 alignment); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#ifdef XPT_TGT_PC +#pragma pack(pop) +#endif + +#endif // _CRI_HEAP_H_INCLUDED + +/* end of file */ diff --git a/3rdParty/cri/pc/include/cri_movie.h b/3rdParty/cri/pc/include/cri_movie.h new file mode 100644 index 00000000..7dad4454 --- /dev/null +++ b/3rdParty/cri/pc/include/cri_movie.h @@ -0,0 +1,4402 @@ +/**************************************************************************** + * + * CRI Middleware SDK + * + * Copyright (c) 2006-2013 CRI Middleware Co., Ltd. + * + * Library : CRI Movie + * Module : Library User's Header + * File : cri_movie.h + * Date : 2013-11-27 + * Version : (see CRIMOVIE_VER) + * + ****************************************************************************/ +/*! + * \file cri_movie.h + */ +#ifndef CRI_MOVIE_H_INCLUDED /* Re-definition prevention */ +#define CRI_MOVIE_H_INCLUDED + +/* Version No. */ +#define CRIMOVIE_VER "3.50" +#define CRIMOVIE_NAME "CRI Movie" + +/*************************************************************************** + * Include file + ***************************************************************************/ +#include +#include +#include +#include +#include +#include + +/*************************************************************************** + * MACRO CONSTANT + ***************************************************************************/ +/*EN + * \brief Maximum length of a filename that can be opened by EasyPlayer + * \ingroup MDL_MV_OPTION + * \sa CriMvEasyPlayer::SetFile() + */ +/*JP + * \brief EasyPlayerに指定可能なファイル名の最大長さ + * \ingroup MDL_MV_OPTION + * \sa CriMvEasyPlayer::SetFile() + */ +#define CRIMV_MAX_FILE_NAME (256) + +/*EN + * \brief Default audio track setting used by AttachSubAudioInterface(), ReplaceCenterVoice() + * \ingroup MDL_MV_OPTION + * \sa CriMvEasyPlayer::ReplaceCenterVoice(), CriMvEasyPlayer::AttachSubAudioInterface() + */ +/*JP + * \brief サブオーディオ(またはセンターボイス)のデフォルト値 + * \ingroup MDL_MV_OPTION + * \sa CriMvEasyPlayer::ReplaceCenterVoice(), CriMvEasyPlayer::AttachSubAudioInterface() + */ +#define CRIMV_CENTER_VOICE_OFF (-1) + + +/*************************************************************************** + * Variable Declaration + ***************************************************************************/ +namespace CriMv { + extern CriError ErrorContainer; +} + +/*************************************************************************** + * Prototype Functions + ***************************************************************************/ +/*EN + * \brief CRI Movie Namespace + * \ingroup MDL_MV_BASIC + * \par + * Namespace for all CRI Movie methods, constants, and declarations + */ +/*JP + * \brief CRI Movie Namespace + * \ingroup MDL_MV_BASIC + * \par + * Namespace for all CRI Movie methods, constants, and declarations + */ +namespace CriMv { + + /*EN + * \brief Returns the version number and build information of CRI Movie + * \param none + * \return A string constant + * + * Returns the version number and build information of CRI Movie as a constant + * string, in the form + * + * "CRI Movie/{PLATFORM} {VERSION} Build:{BUILD DATE}" + */ + /*JP + * \brief CRI Movieのバージョン番号やビルド情報を返します。 + * \return ライブラリ情報文字列 + * + */ + const CriChar8* CRIAPI GetLibraryVersionString(void); + + /*EN + * \brief Initialize the CRI Movie library + * \param err Optional error code + * + * Does one-time initialization of the CRI Movie library.
+ * This function must be successfully called before calling CriMvEasyPlayer::Create().
+ *
+ * In general, all CRI Movie APIs are available after calling CriMv::Initialize(), + * until CriMv::Finalize() is called. However, there are some methods that set options + * for the library as a whole which must be called before CriMv::Initialize():
+ *
+ * It is safe to call CriMv::Initialize() more than once, as long as your application calls + * CriMv::Finalize() once for each call to CriMv::Initialize(). Multiple calls will not + * have an effect on the library, other than to increment or decrement an internal counter. + * + * \sa CriMv::Finalize() + */ + /*JP + * \brief CRI Movieライブラリの初期化 + * \param err エラー情報(省略可) + * + * CRI Movie ライブラリを初期化します。
+ * CriMvEasyPlayer::Create 関数よりも先に呼び出してください。
+ *
+ * 原則として全ての CRI Movie ライブラリ関数は初期化後、終了関数呼び出しまでの間にのみ使用します。
+ * ただし、いくつかの設定関数は初期化関数よりも先に呼び出す必要があるものがあります。 + * 詳細は各設定関数の説明を参照してください。 + *
+ * 初期化関数を複数回呼び出した場合、2回目以降の呼び出しでは呼び出し回数を記録するだけで再初期化は行いません。
+ * この場合、正しく終了処理を行うには同じ回数だけ終了関数を呼び出す必要があります。 + * 初期化関数と終了関数は必ず対で呼び出すように実装してください。
+ * + * \sa CriMv::Finalize() + */ + void CRIAPI Initialize(CriError &err = CriMv::ErrorContainer); + + /* MEMO: + * If an application calls this function instead of CriMv::Initialize(), + * an application need to call CriMv::SetupMovieHandleWork() before CriMv::InitializeMana(). + */ + void CRIAPI InitializeMana(CriError &err = CriMv::ErrorContainer); + + /*EN + * \brief Initialize 32bit ARGB frame conversion + * + * This function initializes 32bit ARGB frame conversion.
+ * When an application uses CriMvEasyPlayer::GetFrameOnTimeAs32bitARGB(), + * please call this function after CriMv::Initialize().
+ * + * \sa CriMvEasyPlayer::GetFrameOnTimeAs32bitARGB() + */ + /*JP + * \brief 32bitARGB用フレーム変換の初期化 + * + * 32bitARGB用フレーム変換処理を初期化します。
+ * CriMvEasyPlayer::GetFrameOnTimeAs32bitARGB() を使用する場合は CRI Movie ライブラリの + * 初期化後に必ず呼び出してください。
+ * + * \sa CriMvEasyPlayer::GetFrameOnTimeAs32bitARGB() + */ + void CRIAPI InitializeFrame32bitARGB(void); + +#if defined(XPT_TGT_IPHONE) || defined(XPT_TGT_WINMO) || defined(XPT_TGT_ANDROID) || defined(XPT_TGT_CQSH2A) || defined(XPT_TGT_ACRODEA) || defined(XPT_TGT_NACL) || defined(XPT_TGT_SH7269) || defined(XPT_TGT_PC) || defined(XPT_TGT_TRGP6K) + void CRIAPI InitializeFrameRGB565(void); +#endif + + /*EN + * \brief De-initializes the CRI Movie library + * \param err Optional error code + * + * This function finalize whole CRI Movie library.
+ * An application needs to destroy all CriMvEasyPlayer handles and decoding threads before callign CriMv::Finalize().
+ *
+ * In principle, all CRI Movie library APIs are enabled after CriMv::Initialize() until CriMv::Finalize().
+ * But there are some APIs for parameter setting, which need to be called after CriMv::Finalize(). + * For details, refer to each explanations of setting APIs. + *
+ * \remarks + * CriMv::Finalize() must be called once for each call to CriMv::Initialize(). When the + * internal initialization count reaches 0, the library will be finalized. + * + * \sa CriMv::Initialize() + */ + /*JP + * \brief CRI Movieライブラリの終了 + * \param err エラー情報(省略可) + * + * CRI Movie ライブラリを終了します。
+ * この関数を呼び出す前に、全ての CriMvEasyPlayer ハンドルおよびデコードスレッドを破棄してください。
+ *
+ * 原則として全ての CRI Movie ライブラリ関数は初期化後、終了関数呼び出しまでの間にのみ使用します。
+ * ただし、いくつかの設定関数は終了関数よりも後に呼び出す必要があるものがあります。 + * 詳細は各設定関数の説明を参照してください。 + *
+ * 初期化関数を複数回呼び出した場合、正しく終了処理を行うには同じ回数だけ終了関数を呼び出す必要があります。 + * 初期化関数と終了関数は必ず対で呼び出すように実装してください。
+ * + * \sa CriMv::Initialize() + */ + void CRIAPI Finalize(CriError &err = CriMv::ErrorContainer); + +#if !defined(XPT_TGT_EE) + /*EN + * \brief Calculates the work buffer size needed for the given number of movie handles + * \param max_num Maximum number of movie handles desired + * \param err Optional error code + * \return The necessary work buffer size, in bytes + * + * Each active movie handle requires an internal work buffer. If your application + * needs to have multiple movies open at one time, it should determine how many handles + * it needs, allocate a buffer of the size returned by this function, and pass it to + * CriMv::SetupMovieHandleWork().
+ * + * Each CriMvEasy object uses a movie handle. Alpha movie playback uses two handles. + * If you need to play aplha movies, be sure to double the number of handles requested. + * + * \remarks + * The number of movie handles must be set before calling CriMv::Initialize(). + * + * \sa CriMv::SetupMovieHandleWork() + */ + /*JP + * \brief マルチハンドル用ワークバッファサイズの計算 + * \param max_num 最大ハンドル数(不透明ムービの再生時) + * \param err エラー情報(省略可) + * \return ワークサイズ + * + * 同時に使用する CriMvEasyPlayer ハンドルの最大数を増加させる場合に必要なワークバッファ + * サイズを計算します。 + * + * アルファムービを再生するとハンドル資源を2つ消費します。 + * もし複数のアルファムービ再生を行いたい場合は、最大ハンドル数は倍にして指定してください。 + * + * \sa CriMv::SetupMovieHandleWork() + */ + CriUint32 CRIAPI CalcMovieHandleWork(CriUint32 max_num, CriError &err = CriMv::ErrorContainer); + + /*EN + * \brief Increases the default number of available movie handles + * \param max_num Maximium number of movie handles + * \param workbuf Work buffer + * \param worksize Size of work buffer + * \param err Optional error code + * + * Call this function if your application needs to increase the maximum number of open movies + * beyond the default. Note that playing an alpha movie requires a second handle.
+ * + * The default number of movie handles depends on the platform.
+ * + * The work buffer must be allocated based on the size returned by CriMv::CalcMovieHandleWork().
+ * + * \remarks + * This function must be called before calling CriMv::Initialize(). + * + * \sa CriMv::CalcMovieHandleWork() + */ + /*JP + * \brief マルチハンドル用ワークバッファの設定 + * \param max_num 最大ハンドル数(不透明ムービの再生時) + * \param workbuf ワークバッファアドレス + * \param worksize ワークバッファサイズ + * \param err エラー情報(省略可) + * + * 同時に使用する CriMvEasyPlayer ハンドルの最大数を増加させるためのワークバッファを設定します。 + * なお、ワークバッファを指定しない場合のハンドル数上限は機種によって異なります。 + * + * ワークバッファの設定は、 CriMv::Initialize() の呼び出しに実行してください。 + * + * \sa CriMv::CalcMovieHandleWork() + */ + void CRIAPI SetupMovieHandleWork(CriUint32 max_num, void *workbuf, CriUint32 worksize, CriError &err = CriMv::ErrorContainer); + + /*EN + * \brief Get max number of movie handles + * \param err Optional error code + * \return Max number of movie handles you set by CriMv::SetupMovieHandleWork(). + * + * Returns the maximum number of movie handles that are available to CRI Movie.
+ * + * Note that this is not necessarily equal to the number of movies that can be + * opened at a time. In general, each movie will use one handle; however, + * alpha channel movies uses two handles. + * + * \sa CriMv::SetupMovieHandleWork(), CriMv::CalcMovieHandleWork() + */ + /*JP + * \brief 最大ハンドル数の取得 + * \param err エラー情報(省略可) + * \return CriMv::SetupMovieHandleWork() で設定した最大ハンドル数 + * + * CriMv::CalcMovieHandleWork() で最大ハンドル数を増加させた場合に、 + * 設定した最大ハンドル数を取得します。 + * + * \sa CriMv::SetupMovieHandleWork(), CriMv::CalcMovieHandleWork() + */ + CriUint32 CRIAPI GetMaxNumberOfHandles(CriError &err = CriMv::ErrorContainer); +#endif + + /* For Sofdec2 */ + CriSint32 CRIAPI CalcHandleWorkSize(CriMvHandleConfig *config, CriError &err = CriMv::ErrorContainer); + void CRIAPI SetDelayDestroySubmodules(CriBool sw); +} + +/*************************************************************************** + * CLASS + ***************************************************************************/ +/*EN + * \brief File Reading Interface Class for EasyPlayer + * \ingroup MDL_IF_READER + * \par + * You can implement your own streaming filesystem for movie playback by deriving + * from this class.
+ * + * Pass an instance of this subclass to CriMvEasyPlayer::Create().
+ * + * This class is designed for asynchronous operation. All functions are pure virtual. + * + * \sa CriMvEasyPlayer::Create() + */ +/*JP + * \brief ファイル読み込みインタフェース for EasyPlayer + * \ingroup MDL_IF_READER + * + * このクラスを定義することで、自前のファイルシステムを使ってEasyPlayerの + * ストリーミング再生が可能になります。
+ * 全ての関数は純粋仮想関数として定義されているので、全ての関数を必ず実装してください。 + * + * \sa CriMvEasyPlayer::Create() + */ +class CriMvFileReaderInterface +{ +public: + /*EN Status of an asynchronous operation */ + /*JP 非同期処理ステータス */ + enum AsyncStatus { + ASYNC_STATUS_STOP, /*EN< No action */ + /*JP< 何もしていない状態。*/ + ASYNC_STATUS_BUSY, /*EN< Currently processing */ + /*JP< 処理中 */ + ASYNC_STATUS_COMPLETE, /*EN< Processing completed */ + /*JP< 処理終了 */ + ASYNC_STATUS_ERROR, /*EN< An error occured */ + /*JP< エラー */ + + /* Keep enum 4bytes */ + ASYNC_STATUS_MAKE_ENUM_SINT32 = 0x7FFFFFFF + }; + /*EN Offset values for Seek() */ + /*JP シーク開始位置 */ + enum SeekOrigin { + SEEK_FROM_BEGIN, /*EN< Start of file */ + /*JP< ファイル先頭 */ + SEEK_FROM_CURRENT, /*EN< Current position in file */ + /*JP< ファイルの現在位置 */ + SEEK_FROM_END, /*EN< End of file */ + /*JP< ファイル終端 */ + + /* Keep enum 4bytes */ + SEEK_FROM_MAKE_ENUM_SINT32 = 0x7FFFFFFF + }; + /*EN + * \brief Opens a file asynchronously + * \param fname Name of file to open + * + * Initiates a file open request, and returns immediately. + * + * To determine success or failure, call CriMvFileReaderInterface::GetOpenStatus().
+ * + * \remarks + * CRI Movie may call CriMvFileReaderInterface::Read() and CriMvFileReaderInterface::Close() + * before CriMvFileReaderInterface::GetOpenStatus() returns ASYNC_STATUS_COMPLETE. + * + * \sa CriMvFileReaderInterface::GetOpenStatus() + */ + /*JP + * \brief ファイル名によるファイルオープン(即時復帰) + * \param fname ファイル名の文字列 + * + * ファイル名指定でファイルのオープン要求を出します。
+ * この関数は即時復帰の関数として呼び出されます。
+ * オープン処理が終わったかどうかは CriMvFileReaderInterface::GetOpenStatus関数 + * でチェックできるようにしてください。
+ * CRI Movie ライブラリはオープン処理が終わる(= CriMvFileReaderInterface::GetOpenStatus関数が + * ASYNC_STATUS_COMPLETEを返す)前に、リード、クローズの要求を呼び出す可能性があります。 + * + * \sa CriMvFileReaderInterface::GetOpenStatus() + */ + /* pure */ virtual void Open(CriChar8 *fname)=0; + + /*EN + * \brief Closes a file asynchronously + * + * Initiates a file close request, and returns immediately.
+ * + * To determine success or failure, call CriMvFileReaderInterface::GetCloseStatus().
+ * + * \sa CriMvFileReaderInterface::GetCloseStatus() + */ + /*JP + * \brief ファイルのクローズ(即時復帰) + * + * オープン済みのファイルのクローズ要求を出します。
+ * この関数は即時復帰の関数として呼び出されます。
+ * クローズ処理が終わったかどうかは CriMvFileReaderInterface::GetCloseStatus() + * でチェックできるようにしてください。 + * + * \sa CriMvFileReaderInterface::GetCloseStatus() + */ + /* pure */ virtual void Close(void)=0; + + /*EN + * \brief Reads from a file + * \param buffer Buffer to read into + * \param req_size Size of the buffer + * + * Initiates a file read request, and returns immediately.
+ * + * The buffer must be available and writable until the read request completes.
+ * + * To determine success or failure, call CriMvFileReaderInterface::GetReadStatus().
+ * + * To determine the number of bytes actually read, call CriMvFileReaderInterface::GetReadSize() + * after CriMvFileReaderInterface::GetReadStatus() has returned ASYNC_STATUS_COMPLETE. + * + * \remarks + * CRI Movie may call CriMvFileReaderInterface::Close() before + * CriMvFileReaderInterface::GetReadStatus() returns ASYNC_STATUS_COMPLETE. + * + * \sa CriMvFileReaderInterface::GetReadStatus(), CriMvFileReaderInterface::GetReadSize() + */ + /*JP + * \brief 読み込み要求(即時復帰) + * \param buffer 書き出しバッファのポインタ。読み込み要求サイズを満たすだけのバッファを確保しておく必要があります。 + * \param req_size 読み込み要求サイズ。単位はバイト単位です。 + * + * ファイルの読み込み要求を出します。
+ * この関数は即時復帰の関数として呼び出されます。
+ * リード処理が終わったかどうかは CriMvFileReaderInterface::GetReadStatus() + * でチェックできるようにしてください。
+ * CRI Movie ライブラリはリード処理が終わる(= CriMvFileReaderInterface::GetReadStatus()が + * ASYNC_STATUS_COMPLETEを返す)前に、クローズ要求を呼び出す可能性があります。
+ * この関数は読み込んだサイズを返しません。
+ * 読み込み済みサイズは、 CriMvFileReaderInterface::GetReadStatus()が ASYNC_STATUS_COMPLETEを + * 返したあとに CriMvFileReaderInterface::GetReadSize()で返すように実装してください。 + * + * \sa CriMvFileReaderInterface::GetReadStatus(), CriMvFileReaderInterface::GetReadSize() + */ + /* pure */ virtual void Read(CriUint8 *buffer, CriSint64 req_size)=0; + + /*EN + * \brief Gets asynchronous status of a call to CriMvFileReaderInterface::Open() + * + * \return Status of the call + * + * While the Open() call is in process, this will return ASYNC_STATUS_BUSY.
+ * If the call fails, this will return ASYNC_STATUS_ERROR.
+ * On success, this will return ASYNC_STATUS_COMPLETE.
+ * + * \sa CriMvFileReaderInterface::Open() + */ + /*JP + * \brief オープンコマンドの状態取得 + * \return オープンコマンドの処理状態。 + * + * CriMvFileReaderInterface::Open関数の処理状態を取得します。 + * + * \sa CriMvFileReaderInterface::Open() + */ + /* pure */ virtual CriMvFileReaderInterface::AsyncStatus GetOpenStatus(void)=0; + + /*EN + * \brief Gets asynchronous status of a call to CriMvFileReaderInterface::Close() + * + * \return Status of the call + * + * While the Close() call is in process, this will return ASYNC_STATUS_BUSY.
+ * If the call fails, this will return ASYNC_STATUS_ERROR.
+ * On success, this will return ASYNC_STATUS_COMPLETE.
+ * + * \sa CriMvFileReaderInterface::Close() + */ + /*JP + * \brief クローズコマンドの状態取得 + * \return クローズコマンドの処理状態。 + * + * CriMvFileReaderInterface::Close関数の処理状態を取得します。 + * + * \sa CriMvFileReaderInterface::Close() + */ + /* pure */ virtual CriMvFileReaderInterface::AsyncStatus GetCloseStatus(void)=0; + + /*EN + * \brief Gets asynchronous status of a call to CriMvFileReaderInterface::Read() + * + * \return Status of the call + * + * While the Read() call is in process, this will return ASYNC_STATUS_BUSY.
+ * If the call fails, this will return ASYNC_STATUS_ERROR.
+ * On success, this will return ASYNC_STATUS_COMPLETE.
+ * + * \sa CriMvFileReaderInterface::Read() + */ + /*JP + * \brief リードコマンドの状態取得 + * \return リードコマンドの処理状態。 + * + * CriMvFileReaderInterface::Read関数の処理状態を取得します。 + * + * \sa CriMvFileReaderInterface::Read() + */ + /* pure */ virtual CriMvFileReaderInterface::AsyncStatus GetReadStatus(void)=0; + + /*EN + * \brief Gets the number of bytes read by a successful call to CriMvFileReaderInterface::Read() + * + * \return Number of bytes read + * + * Once CriMvFileReaderInterface::GetReadStatus() returns ASYNC_STATUS_COMPLETE, this + * function can be called to determine the number of bytes read by + * CriMvFileReaderInterface::Read().
+ * + * If no call to Read() has been made, this function will return 0.
+ * + * If called multiple times after completing the read, the same value will be returned each time. + * + * \sa CriMvFileReaderInterface::Read(), CriMvFileReaderInterface::GetReadStatus() + */ + /*JP + * \brief 前回読み込み要求に対する読み込み完了サイズ + * \return 読み込み完了サイズ。単位はByte。 + * + * 前回の読み込み要求に対して読み込み完了したサイズを返します。 + * まだ読み込みが1度も要求されていない場合は0を返します。 + * 読み込み完了後に繰り返しこの関数が呼び出された場合は、すべて同じ値を返します。 + * + * \sa CriMvFileReaderInterface::Read(), CriMvFileReaderInterface::GetReadStatus() + */ + /* pure */ virtual CriSint64 GetReadSize(void)=0; + + /*EN + * \brief Seeks to a new position in the file + * + * \param size Number of bytes to seek relative to \a offset + * \param offset Starting position of seek + * \return The offset, in bytes, from the previous file position. + * + * If \a offset is SEEK_FROM_BEGIN, seeking will start from the beginning of the file.
+ * If \a offset is SEEK_FROM_CURRENT, seeking will start from the current file position.
+ * If \a offset is SEEK_FROM_END, seeking will start from the end of the file.
+ * + * \sa CriMvFileReaderInterface::SeekOrigin + */ + /*JP + * \brief シーク + * \param size シークサイズ + * \param offset シークの開始位置 + * \return 実際にシークした距離。Byte単位。 + * + * \sa CriMvFileReaderInterface::SeekOrigin + * + */ + /* pure */ virtual CriSint64 Seek(CriSint64 size, CriMvFileReaderInterface::SeekOrigin offset)=0; + + /*EN + * \brief Gets the file size + * + * \return File size, in bytes + * + * This function can safely be called once CriMvFileReaderInterface::Open() has completed + * successfully. + * + * \sa CriMvFileReaderInterface::Open(), CriMvFileReaderInterface::GetOpenStatus() + */ + /*JP + * \brief ファイルサイズの取得 + * \return ファイルサイズ[byte]. + * + * この関数はファイルオープンの終了後に呼び出されます。 + * + * \sa CriMvFileReaderInterface::Open(), CriMvFileReaderInterface::GetOpenStatus() + */ + /* pure */ virtual CriSint64 GetFileSize(void)=0; + +protected: + virtual ~CriMvFileReaderInterface(void) {} +}; + +/*EN + * \brief Sound Interface Class for EasyPlayer + * \ingroup MDL_IF_SOUND + * + * \par + * A class derived from CriMvSoundInterface is required in order to play sound in CRI Movie. + * Pass an instance of this subclass to CriMvEasyPlayer::Create().
+ * + * If you do not need audio output, you can pass NULL instead. However, if you do, + * you can not use a movie timer of type MVEASY_TIMER_AUDIO. See CriMvEasyPlayer::SetMasterTimer() + * for more details.
+ * + * Sound data must be provided in either 32 or 16 bit PCM format. + * + * All functions are pure virtual. + * + * \sa CriMvEasyPlayer::Create(), CriMvEasyPlayer::SetMasterTimer(), CriMvEasyPlayer::TimerType + */ +/*JP + * \brief サウンド出力インタフェース + * \ingroup MDL_IF_SOUND + * + * \sa CriMvEasyPlayer::Create(), CriMvEasyPlayer::SetMasterTimer(), CriMvEasyPlayer::TimerType + */ +class CriMvSoundInterface +{ +public: + /*EN + * \brief The status of the Sound Module + * + * This is the return value of CriMvSoundInterface::GetStatus().
+ * + * After CriMvSoundInterface::Start() is called, the state transitions to MVEASY_SOUND_STATUS_EXEC.
+ * While the state is MVEASY_SOUND_STATUS_EXEC, the sound module calls the callback function + * to retrieve sound data as needed.
+ * When the EasyPlayer is stopped, or transits to MVEASY_STATUS_PLAYEND, + * CRI Movie will call CriMvSoundInterface::Stop(). Then, CRI Movie waits for + * CriMvSoundInterface::GetStatus() to return MVEASY_SOUND_STATUS_STOP, + * and calls CriMvSoundInterface::DestroyOutput(). + * + * \sa CriMvSoundInterface::GetStatus(), CriMvSoundInterface::Start(), + * CriMvSoundInterface::Stop(), CriMvSoundInterface::DestroyOutput() + */ + /*JP + * \brief サウンドモジュールの状態 + * + * サウンドモジュールの状態を表す列挙型です。
+ * CriMvEasyPlayer::GetStatus() の関数値です。
+ * CriMvSoundInterface::Start() が呼び出されるとMVEASY_SOUND_STATUS_EXEC状態になります。
+ * MVEASY_SOUND_STATUS_EXEC状態の間は、サウンド出力モジュールはコールバック関数を呼び出します。
+ * CRI Movie ライブラリは再生終了または再生停止指示を受けた場合、まず CriMvSoundInterface::Stop()を呼び出します。
+ * その後、STOP状態になるのを待ってから CriMvSoundInterface::DestroyOutput()を呼び出します。 + * + * \sa CriMvSoundInterface::GetStatus(), CriMvSoundInterface::Start(), + * CriMvSoundInterface::Stop(), CriMvSoundInterface::DestroyOutput() + */ + enum Status { + MVEASY_SOUND_STATUS_STOP, /*EN< No sound processing is happening. */ + /*JP< CRI Movie のサウンド出力をしていない状態 */ + MVEASY_SOUND_STATUS_EXEC, /*EN< Sound data is being retrieved and processed. */ + /*JP< CRI Movie のサウンド出力中 */ + MVEASY_SOUND_STATUS_ERROR, /*EN< An error has occurred. */ + /*JP< エラー状態 */ + + /* Keep enum 4bytes */ + MVEASY_SOUND_STATUS_MAKE_ENUM_SINT32 = 0x7FFFFFFF + }; + + /*EN + * \brief PCM audio data format + * + * CRI Movie only operates on PCM encoded data. Two formats are supported: 32 bit floating + * point values, and 16 bit integer values. + * + * Return one of these values from CriMvSoundInterface::GetPcmFormat(). + * According to the returned format, CRI Movie calls a SetCallback for the specified PCM format. + * + * \sa CriMvSoundInterface::GetPcmFormat(), CriMvSoundInterface::SetCallbackGetFloat32PcmData(), + * CriMvSoundInterface::SetCallbackGetSint16PcmData() + */ + /*JP + * \brief PCMデータフォーマット + * + * PCMの出力フォーマットはPcmFormat型で定義されたいずれかでなければいけません。
+ * EasyPlayerは CriMvSoundInterface::GetPcmFormat()で取得できるデータ型のみ使用します。
+ * アプリケーションはこのクラスの全ての関数を実装しなければいけないので、使わないフォーマット + * のコールバック登録関数はカラ関数として実装してください。 + * + * \sa CriMvSoundInterface::GetPcmFormat(), CriMvSoundInterface::SetCallbackGetFloat32PcmData(), + * CriMvSoundInterface::SetCallbackGetSint16PcmData() + */ + enum PcmFormat { + MVEASY_PCM_FLOAT32, /*EN< PCM data is in 32 bit floating point format. */ + /*JP< 32bit 浮動小数型のPCMフォーマット */ + MVEASY_PCM_SINT16, /*EN< PCM data is in 16 bit integer format. */ + /*JP< 16bit 整数型のPCMフォーマット */ + + /* Keep enum 4bytes */ + MVEASY_PCM_MAKE_ENUM_SINT32 = 0x7FFFFFFF + }; + + /*EN + * \brief Creates a sound output module + * \param heap Handle to a CriHeap object + * \param channel Number of sound channels (1 = monaural, 2 = stereo, 6 = 5.1ch) + * \param samplerate Sample rate of audio data (ex. 48000 = 48k) + * \return TRUE if the sound module was created successfully + * \return FALSE if there was an error + * + * Creates a CRI Movie sound output module and prepares it for use. Memory for the module + * is taken from the provided CriHeap object.
+ * + * CRI Movie calls this method once it has determined that a movie has an active audio track + * and has analyzed the number of channels (mono, stereo, 5.1ch, etc.) and the sample rate. + * + */ + /*JP + * \brief サウンド出力の作成 + * \param heap メモリハンドル + * \param channel 出力するサウンドのチャネル数 (1=monaural, 2=stereo, 6=5.1ch) + * \param samplerate サンプリングレート (ex. 48k = 48000) + * \return 作成結果。成功の場合はTRUE、失敗の場合はFALSEが返ります。 + * + * サウンド出力を作成します。
+ * この関数は CRI Movie が再生するサウンドが決定したあとに、そのサウンドのチャネル数や + * サンプリングレートを引数として実行されます。 + * + */ + /* pure */ virtual CriBool CreateOutput(CriHeap heap, CriUint32 channel, CriUint32 samplerate)=0; + + /*EN + * \brief Destroys the sound output module + * + * Deletes the sound output module that was created by + * CriMvSoundInterface::CreateOutput().
+ * + * CRI Movie calls this method once CriMvSoundInterface::GetStatus() returns MVEASY_SOUND_STATUS_STOP. + * + */ + /*JP + * \brief サウンド出力の破棄 + * + * サウンド出力を破棄します。
+ * この関数はサウンド出力が MVEASY_SOUND_STATUS_STOP 状態になった後に呼び出されます。 + * + */ + /* pure */ virtual void DestroyOutput(void)=0; + + /*EN + * \brief Gets the PCM format of audio data + * \return The type of PCM format supported by this CriMvSoundInterface instance + * + * CRI Movie supports audio data in one of two PCM formats: 32 bit floating point (MVEASY_PCM_FLOAT32) + * or 16 bit integer (MVEASY_PCM_SINT16). EasyPlayer uses the return value from this method to + * determine which format is being used, and will call the appropriate callback function to retrieve + * data samples. + * + * \sa CriMvSoundInterface::PcmFormat + */ + /*JP + * \brief PCMデータフォーマットの取得 + * \return CriMvSoundInterface が使用するPCMフォーマットを返します。 + * + * EasyPlayerはこの関数によって、出力するPCMフォーマットを判断します。 + * + * \sa CriMvSoundInterface::PcmFormat + */ + /* pure */ virtual PcmFormat GetPcmFormat(void)=0; + + /*EN + * \brief Sets the callback function for retrieving 32 bit floating point PCM sound samples + * \param func Function that is called when CriMvSoundInterface gets PCM data (32bit float) + * \param obj Pointer to user-specifed data, passed as the first argument to the callback + * + * Sets a function that CriMvSoundInterface will call when it needs audio data in 32 bit floating point + * PCM format. This callback function takes 4 arguments:
+ * + * - \a obj: The user-specified \a obj parameter passed to SetCallbackGetFloat32PcmData().
+ * - \a nch: The number of audio channels. Mono is 1, stereo is 2, 5.1 channel is 6.
+ * - \a pcmbuf: An array of buffers to hold the returned PCM data. There must be one element of + * this array for each channel.
+ * - \a req_nsmpl: The number of samples requested. Each buffer must be large enough to hold this + * many samples (i.e. \a nch * \a req_nsmpl). + * + * \remarks + * The maximum number of channels is CRIMV_PCM_BUFFER_MAX + * + * \sa CriMvSoundInterface::SetCallbackGetSint16PcmData() + */ + /*JP + * \brief 32bit形式でPCMデータを取得するコールバック関数の登録 + * \param func CriMvSoundInterface がPCMデータを要求する際に呼びだすコールバック関数 + * \param obj コールバック関数を実行する際に第一引数に指定するオブジェクト変数 + * + * CriMvSoundInterface がEasyPlayerにPCMデータを要求する際に呼び出すコールバック関数を登録します。 + * コールバック関数は4つの引数を持っています。
+ * - "obj" はコールバック関数内で使用するオブジェクトです。 + * コールバック関数を呼び出す際は、関数登録時に指定されたobjを必ずこの引数に入れてください。
+ * - "nch" は CriMvSoundInterface が要求するオーディオのチャネル数です。モノラルなら1。ステレオなら2。5.1chなら6となります。
+ * - "pcmbuf" はPCMデータを格納するためのバッファポインタ配列です。
+ * バッファの実体は CriMvSoundInterface で準備してください。バッファの数は"nch"と同じでなければいけません。
+ * - "req_nsmpl" は CriMvSoundInterface が要求するPCMデータの最大サンプル数です。
+ * "pcmbuf"で指定した各バッファ実体には、このサンプル数が書き込まれても大丈夫なだけの領域を必ず準備してください。
+ * + * 登録されたコールバック関数を呼び出すタイミングは CriMvSoundInterface の任意となります。 + * + * \sa CriMvSoundInterface::SetCallbackGetSint16PcmData() + */ + /* pure */ virtual void SetCallbackGetFloat32PcmData(CriUint32 (*func)(void *obj, CriUint32 nch, CriFloat32 *pcmbuf[], CriUint32 req_nsmpl), void *obj)=0; + + /*EN + * \brief Sets the callback function for retrieving 16 bit integer PCM sound samples + * \param func Function that will be called when 16 bit integer PCM data is needed + * \param obj Pointer to user-specifed data, passed as the first argument to the callback + * + * Sets a function that CriMvSoundInterface will call when it needs audio data in 16 bit integer + * PCM format. This callback function takes 4 arguments:
+ * + * - \a obj: The user-specified \a obj parameter passed to SetCallbackGetSint16PcmData().
+ * - \a nch: The number of audio channels. Mono is 1, stereo is 2, 5.1 channel is 6.
+ * - \a pcmbuf: An array of buffers to hold the returned PCM data. There must be one element of + * this array for each channel.
+ * - \a req_nsmpl: The number of samples requested. Each buffer must be large enough to hold this + * many samples (i.e. \a nch * \a req_nsmpl). + * + * \remarks + * The maximum number of channels is CRIMV_PCM_BUFFER_MAX (currently 8) + * + * \sa CriMvSoundInterface::SetCallbackGetFloat32PcmData() + */ + /*JP + * \brief 16bit形式でPCMデータを取得するコールバック関数の登録 + * \param func CriMvSoundInterface がPCMデータを要求する際に呼びだすコールバック関数 + * \param obj コールバック関数を実行する際に第一引数に指定するオブジェクト変数 + * + * PCMフォーマットが違う以外は、 CriMvSoundInterface::SetCallbackGetFloat32PcmData() と同じです。 + * + * \sa CriMvSoundInterface::SetCallbackGetFloat32PcmData() + */ + /* pure */ virtual void SetCallbackGetSint16PcmData(CriUint32 (*func)(void *obj, CriUint32 nch, CriSint16 *pcmbuf[], CriUint32 req_nsmpl), void *obj)=0; + + /*EN + * \brief Starts sound output + * + * CRI Movie will call this method when it needs to start playing sound. The PCM data callback function + * has to be called after this function until movie playback is finished.
+ * + * Your sound module should begin incrementing its playback time when this method is called. + * + * \remarks + * On success, this should set the status to CriMvSoundInterface::MVEASY_SOUND_STATUS_EXEC. + */ + /*JP + * \brief サウンド出力の開始 + * + * サウンド出力を開始します。PCMデータ取得用コールバック関数は、本関数の呼出し後から実行してください。 + */ + /* pure */ virtual void Start(void)=0; + + /*EN + * \brief Stops sound output + * + * CRI Movie will call this when the movie playback stops, or the status changes to MVEASY_STATUS_PLAYEND.
+ * + * When EasyPlayer wants to pause and restart playback, it will call CriMvSoundInterface::Pause() + * instead of this method.
+ * + * Your sound module should set its playback time to 0 when this method is called. + * + * \remarks + * This should set the status to CriMvSoundInterface::MVEASY_SOUND_STATUS_STOP. + * + * \sa CriMvSoundInterface::Pause(), CriMvSoundInterface::Start() + */ + /*JP + * \brief サウンド出力の停止 + * + * サウンド出力を停止します。再開できるようにする必要はありません。
+ * EasyPlayerが再開処理を行いたい場合は、本関数ではなく、 CriMvSoundInterface::Pause()を呼び出します。
+ * CriMvSoundInterface::Stop() 呼出し後は、コルーバック関数を呼ばないように実装してください。 + * + * \sa CriMvSoundInterface::Pause(), CriMvSoundInterface::Stop() + */ + /* pure */ virtual void Stop(void)=0; + + /*EN + * \brief Gets status of sound module + * \return The module status + * + * This must return one of the enumerated values in CriMvSoundInterface::Status.
+ * + * While this method returns CriMvSoundInterface::MVEASY_SOUND_STATUS_EXEC, EasyPlayer will call the + * PCM data callback.
+ * When a movie has finished playing and this method returns CriMvSoundInterface::MVEASY_SOUND_STATUS_STOP, + * EasyPlayer will call CriMvSoundInterface::DestroyOutput(). + * + * \sa CriMvSoundInterface::Status + */ + /*JP + * \brief サウンドモジュールの状態取得 + * + * サウンドモジュールの状態を取得します。 + * + * \sa CriMvSoundInterface::Status + */ + /* pure */ virtual Status GetStatus(void)=0; + + /*EN + * \brief Pauses or resumes sound output + * \param sw Pause or resume playback. + * + * If \a sw is 1 (ON), output will be paused.
+ * If \a sw is 0 (OFF), output will be resumed.
+ * + * Temporarily pauses or resumes sound output.
+ * + * When you pause sound output, you must pause your playback timer as well. + */ + /*JP + * \brief サウンド出力の一時停止または再開 + * \param sw ポーズスイッチ。ポーズONの場合は1、ポーズOFF(レジューム)の場合は0を指定します。 + * + * 本関数の動作は引数に依存します。
+ * 引数 sw がON(1)なら、一時停止。引数 sw がOFF(0)ならサウンド出力再開です。 + */ + /* pure */ virtual void Pause(CriBool sw)=0; + + /*EN + * \brief Gets the time, in seconds, that sound has been playing + * \param count Playback time counter + * \param unit Counter increment per second + * + * CRI Movie calls this method periodically for some damn reason.
+ *
+ * The time, in seconds, is specified by \a count / \a unit.
+ * + * For example, if \a count was 500 and \a unit was 1000, that would be 0.5 seconds.
+ * + * \remarks + * Before Start() is called, and after Stop() is called, \a count should be 0. + */ + /*JP + * \brief 再生時刻の取得 + * \param count タイマカウント + * \param unit 1秒あたりのタイマカウント値。count ÷ unit で秒単位の時刻となります。 + * + * タイマ時刻を取得します。時刻はcountとunitの二つの変数で表現します。
+ * count ÷ unit で秒単位の時刻となるような値を返します。
+ * 再生開始前( CriMvSoundInterface::Start()呼び出し前)および + * 再生停止後( CriMvSoundInterface::Stop()呼び出し後)は、時刻0(タイマカウントが0)を返します。 + */ + /* pure */ virtual void GetTime(CriUint64 &count, CriUint64 &unit)=0; // sec = count / unit. + +protected: + virtual ~CriMvSoundInterface(void) {} +}; + +/*EN + * \brief System Timer Interface Class for EasyPlayer + * \ingroup MDL_IF_TIMER + * + * If you want to synchronize video frames with something other than the audio track, or if you + * need to play a movie that does not have an audio track, you will need to pass an instance of + * a class derived from CriMvSystemTimerInterface to CriMvEasyPlayer::Create().
+ * + * If you do not need any special timer facilities, you can pass NULL to CriMvEasyPlayer::Create() instead.
+ * + * All functions are pure virtual. + * + * \sa CriMvEasyPlayer::Create(), CriMvEasyPlayer::SyncMasterTimer() + */ +/*JP + * \brief システムタイマーインタフェース for EasyPlayer + * \ingroup MDL_IF_TIMER + * + * システムタイマーは音無しムービ再生時に、ビデオフレームの送出タイミングを調整するために使用されます。
+ * このクラスを定義することで、自前のタイマシステムを使ってEasyPlayerのストリーミング再生が可能になります。
+ * 全ての関数は純粋仮想関数として定義されているので、全ての関数を必ず実装してください。 + * + * \sa CriMvEasyPlayer::Create(), CriMvEasyPlayer::SyncMasterTimer() + */ +class CriMvSystemTimerInterface +{ +public: + /*EN + * \brief Starts timer and resets it to 0 + * + * When this method is called, your internal counter should initialize itself to 0 and start + * normal operation. + */ + /*JP + * \brief タイマ開始 + * + * タイマのカウントを開始します。この関数が呼ばれた時が時刻0となります。 + */ + /* pure */ virtual void Start(void)=0; + + /*EN + * \brief Stops the timer and resets it to 0 + * + * When this method is called, your internal counter should stop incrementing, and re-initialize + * itself to 0. After this method has been called, CriMvSystemTimerInterface::GetTime() must + * return a time of 0 seconds. + */ + /*JP + * \brief タイマ停止 + * + * タイマのカウントを停止します。この関数が呼ばれたあとに、そのタイマを再開することはありません。 + */ + /* pure */ virtual void Stop(void)=0; + + /*EN + * \brief Pauses or resumes the timer + * + * \param sw Pause or resume timer operation. + * + * If \a sw is 1 (ON), the timer will be paused.
+ * If \a sw is 0 (OFF), the timer will be resumed.
+ * + * Temporarily pauses or resumes the timer.
+ * + * When you pause the timer, you must maintain the previous value of the counter. + */ + /*JP + * \brief タイマの一時停止または再開 + * \param sw ポーズスイッチ。ON(1)なら一時停止、OFF(0)なら再開。 + * + * 本関数の動作は引数に依存します。
+ * 引数 sw がON(1)なら、一時停止。引数 sw がOFF(0)ならタイマカウント再開です。 + */ + /* pure */ virtual void Pause(CriBool sw)=0; + + /*EN + * \brief Gets the time, in seconds, that the timer has been running + * + * \param count Timer counter + * \param unit Counter increment per second + * + * CRI Movie calls this method periodically to synchronize video playback with the + * movie's internal framerate.
+ *
+ * The time, in seconds, is specified by \a count / \a unit.
+ * + * For example, if \a count was 500 and \a unit was 1000, that would be 0.5 seconds.
+ * + * \remarks + * Before Start() is called, and after Stop() is called, \a count should be 0. + */ + /*JP + * \brief 経過時刻の取得 + * \param count タイマカウント + * \param unit 1秒あたりのタイマカウント値。count ÷ unit で秒単位の時刻となります。 + * + * タイマ時刻を取得します。時刻はcountとunitの二つの変数で表現します。
+ * count ÷ unit で秒単位の時刻となるような値を返します。
+ * 再生開始前( CriMvSystemTimerInterface::Start()呼び出し前)および + * 再生停止後( CriMvSystemTimerInterface::Stop()呼び出し後)は、時刻0(タイマカウントが0)を返します。 + */ + /* pure */ virtual void GetTime(CriUint64 &count, CriUint64 &unit)=0; + +protected: + virtual ~CriMvSystemTimerInterface(void) {} +}; + + +/*EN + * \brief EasyPlayer Interface class for CRI Movie + * \ingroup MDL_EASY_PLAYER + */ +/*JP + * \brief EasyPlayerインタフェース + * \ingroup MDL_EASY_PLAYER + */ +class CriMvEasyPlayer : public CriAllocator +{ +public: + /*EN + * \brief The possible states an EasyPlayer handle can be in. + * + * An EasyPlayer handle takes on various states, depending on where it is in the decoding process. + * You can check the status of a valid EasyPlayer handle at any time by calling CriMvEasyPlayer::GetStatus(). + * + * An EasyPlayer handle is created in the MVEASY_STATUS_STOP state. During movie playback, the status + * transitions through various states from MVEASY_STATUS_STOP to MVEASY_STATUS_PLAYEND. + * + * An application does not need to check all states. At a minimum, it only needs to check for + * MVEASY_STATUS_STOP, MVEASY_STATUS_PLAYING, MVEASY_STATUS_PLAYEND, + * and MVEASY_STATUS_ERROR. + * + * If an application calls CriMvEasyPlayer::DecodeHeader(), the status of the EasyPlayer handle will change to + * MVEASY_STATUS_WAIT_PREP when CRI Movie has finished analyzing the movie information. The EasyPlayer + * handle will remain in this state until the application calls CriMvEasyPlayer::Prepare() or + * CriMvEasyPlayer::Start(). Once the state has changed to MVEASY_STATUS_WAIT_PREP, information + * about the movie can be retrieved by calling CriMvEasyPlayer::GetMovieInfo(). + * + * If an application calls CriMvEasyPlayer::Prepare(), the EasyPlayer handle status will change to + * MVEASY_STATUS_READY once CRI Movie has finished buffering enough input and decoded output for playback. + * The handle will remain in this state until CriMvEasyPlayer::Start() is called. This allows the application + * to better control playback timing, since a movie can immediately start playing. + * + * Once CriMvEasyPlayer::Start() is called and the movie is actively playing, the status will alternate + * between MVEASY_STATUS_PLAYING and MVEASY_STATUS_PREP, as CRI Movie plays back frames and decodes + * new ones. + * + * When the movie has finished playing normally, the status of the EasyPlayer handle will automatically change + * to MVEASY_STATUS_PLAYEND. If the movie is in looping mode, however, once the movie reaches the + * end, it will start playing from the beginning and the status will not change to MVEASY_STATUS_PLAYEND. + * + * When CriMvEasyPlayer::Stop() is called, the status of the handle will change to MVEASY_STATUS_STOP + * once it has finished any decoding and playback that is in progress. This does not happen immediately, + * but will take a few cycles. + * + * If there are any problems during playback, for instance insufficient memory or invalid input data, the + * status will change to MVEASY_STATUS_ERROR. When the handle is in state MVEASY_STATUS_ERROR, + * the application must call CriMvEasyPlayer::Stop() and wait until the state changes to MVEASY_STATUS_STOP + * before doing anything else with the handle. + * + * Once the state is MVEASY_STATUS_STOP or MVEASY_STATUS_PLAYEND, the handle can be deleted by + * calling CriMvEasyPlayer::Destroy(). + * + * \attention + * As of CRI Movie version 2.00, the handling of the MVEASY_STATUS_ERROR state has changed. Previously, + * a handle could be destroyed when it was in the MVEASY_STATUS_ERROR state. Now, an application + * must call CriMvEasyPlayer::Stop() and wait for the MVEASY_STATUS_STOP state before destroying + * the handle. + * + * \sa CriMvEasyPlayer::GetStatus(), CriMvEasyPlayer::Start(), CriMvEasyPlayer::DecodeHeader(), + * CriMvEasyPlayer::Prepare(), CriMvEasyPlayer::GetMovieInfo(), CriMvEasyPlayer::Stop(), + * CriMvEasyPlayer::Destroy() + */ + /*JP + * \brief EasyPlayerハンドル状態 + * + * EasyPlayer のハンドル状態です。 + * ハンドル状態は CriMvEasyPlayer::GetStatus() でいつでも取得することが出来ます。
+ * ハンドル作成直後は MVEASY_STATUS_STOP 状態です。 + * + * ハンドル状態は MVEASY_STATUS_STOP から MVEASY_STATUS_PLAYEND まで順に遷移していきます。
+ * アプリケーションがムービを再生するにあたって、必ずしもこの全ての状態をチェックする必要はありません。
+ * 最低限、MVEASY_STATUS_STOP, MVEASY_STATUS_PLAYING, MVEASY_STATUS_PLAYEND, MVEASY_STATUS_ERROR さえ + * チェックすれば、ムービの再生を行うことができます。 + * + * EasyPlayer ハンドル作成後、ムービの解像度などが既に確定している場合は、アプリケーションは + * CriMvEasyPlayer::Start() を直接呼び出すことができます。この場合、ハンドル状態は自動的に + * MVEASY_STATUS_PLAYEND まで遷移していきます。 + * + * 最初に CriMvEasyPlayer::DecodeHeader() を呼び出した場合は、ヘッダ解析が終了するとハンドル状態は + * MVEASY_STATUS_WAIT_PREP となり、アプリケーションから CriMvEasyPlayer::Prepare() または + * CriMvEasyPlayer::Start() が呼ばれるまで待機します。 + * + * MVEASY_STATUS_WAIT_PREP状態以降、 CriMvEasyPlayer::GetMovieInfo() でムービ情報を取得することができます。
+ * CriMvEasyPlayer::Prepare() を呼び出した場合は、ヘッダ解析およびデータのバッファリングが終わると、 + * ハンドル状態は MVEASY_STATUS_READY となり、アプリケーションから CriMvEasyPlayer::Start() が + * 呼ばれるまで待機します。これによって再生開始のタイミングを調整することができます。 + * + * 再生が終了すると自動的に MVEASY_STATUS_PLAYEND になります。 + * + * CriMvEasyPlayer::Stop() を呼び出した場合は、デコーダの停止処理が終わったあとに MVEASY_STATUS_STOP + * 状態になります。 CriMvEasyPlayer::Stop() 終了直後に停止状態になるとは限りません。 + * + * メモリ不足やデータエラーなど何らかの問題が発生した場合は MVEASY_STATUS_ERROR 状態となります。
+ * MVEASY_STATUS_ERROR 状態になった場合は CriMvEasyPlayer::Stop() を呼び出してハンドル状態が + * MVEASY_STATUS_STOP 状態に遷移させてください。
+ * + * CriMvEasyPlayer::Destroy() は MVEASY_STATUS_STOP, MVEASY_STATUS_PLAYEND の + * いずれかの状態の時のみ呼び出すことができます。 + * + * \attention + * CRI Movie Ver.2.00 で MVEASY_STATUS_ERROR 状態についての仕様が変更になりました。
+ * MVEASY_STATUS_ERROR 状態でハンドル破棄が出来なくなり、 CriMvEasyPlay::Stop() を呼び出す必要があります。 + * + * \sa CriMvEasyPlayer::GetStatus(), CriMvEasyPlayer::Start(), CriMvEasyPlayer::DecodeHeader(), + * CriMvEasyPlayer::Prepare(), CriMvEasyPlayer::GetMovieInfo(), CriMvEasyPlayer::Stop(), + * CriMvEasyPlayer::Destroy() + */ + enum Status { + MVEASY_STATUS_STOP, /*EN< Standstill. No processing is happening. + * EasyPlayer handles are created in this state. */ + /*JP< 停止中 */ + MVEASY_STATUS_DECHDR, /*EN< The EasyPlayer handle is now parsing the movie header, + * including information about the width and height of the video stream. */ + /*JP< ヘッダ解析中 */ + MVEASY_STATUS_WAIT_PREP, /*EN< The EasyPlayer handle is a waiting for the work buffer to be allocated. */ + /*JP< バッファリング開始待機中 */ + MVEASY_STATUS_PREP, /*EN< The EasyPlayer handle is now buffering video and audio data. */ + /*JP< 再生準備中 */ + MVEASY_STATUS_READY, /*EN< Ready to start playback. */ + /*JP< 再生待機 */ + MVEASY_STATUS_PLAYING, /*EN< The decoders are currently decoding and playing output. */ + /*JP< 再生中 */ + MVEASY_STATUS_PLAYEND, /*EN< The end of the movie has been reached. */ + /*JP< 再生終了 */ + MVEASY_STATUS_ERROR, /*EN< An error has occurred. */ + /*JP< エラー */ + + /* Keep enum 4bytes */ + MVEASY_STATUS_MAKE_ENUM_SINT32 = 0x7FFFFFFF + }; + + /*EN + * \brief Supported timer types; used to synchronize video frames. + */ + /*JP + * \brief タイマ種別 + */ + enum TimerType { + MVEASY_TIMER_NONE, /*EN< No synchronization. The output is available as soon as + * each frame is decoded. */ + /*JP< ビデオフレームは時刻同期をしません。デコードが終わったフレーム + * はすぐに取得することができます。 */ + MVEASY_TIMER_SYSTEM, /*EN< Video frames synchronize to the system timer.
+ * You must provide an instance of CriMvSystemTimerInterface to + * CriMvEasyPlayer::Create(). */ + /*JP< ビデオフレームはシステム時刻に同期します。システム時刻はアプリケーション + * が CriMvSystemTimerInterface としてCriMvEasyハンドルに設定する必要があります。 */ + MVEASY_TIMER_AUDIO, /*EN< Video frames synchronize with the movie's audio data.
+ * You must provide an instance of CriMvSoundInterface to CriMvEasyPlayer::Create().
+ * If the movie does not have audio, video frames will synchronize with the system timer. */ + /*JP< ビデオフレームはムービのオーディオ時刻に同期します。 + * アプリケーションは GetTime関数を含む CriMvSoundInterface をCriMvEasy + * ハンドルに設定する必要があります。もしもムービデータにオーディオが含まれて + * いない場合は、ビデオはシステム時刻に同期します。 */ + + /* Keep enum 4bytes */ + MVEASY_TIMER_MAKE_ENUM_SINT32 = 0x7FFFFFFF + }; + + /*EN + * \ingroup MODULE_INIT + * + * \brief Creates an EasyPlayer handle + * + * \param heap Handle to a CriHeap object + * \param freader File input interface + * \param stimer System timer interface + * \param sound Sound module interface + * \param err Optional error code + * + * \return A valid CriMvEasyPlayer handle, or NULL if the handle cannot be allocated + * + * Creates and initialize a new EasyPlayer handle. Its status is initially MVEASY_STATUS_STOP. + * Memory for the handle is allocated from the provided CriHeap object. + * + * If memory allocation fails, this function will return NULL. Be sure to initialize and create + * your heap with criHeap_Initialize() and criHeap_Create() before calling this function. + * + * \remarks + * CriMv::Initialize() must be called before calling this function. + * + */ + /*JP + * \ingroup MODULE_INIT + * \brief EasyPlayerハンドルの作成 + * \param heap CriHeapハンドル + * \param freader ファイル読み込みインタフェース + * \param stimer システムタイマインタフェース + * \param sound サウンドインタフェース + * \param err エラー情報 + * \return CriMvEasyハンドルを返します。エラーが発生した場合は、NULLを返します。 + * + * 本関数は CriMv::Initialize() 呼び出しよりもに実行してください。
+ * ハンドル作成後はハンドル状態はMVEASY_STATUS_STOPとなります。
+ * ハンドル確保に必要なメモリは全て、引数で渡された CriHeap を使って確保されます。
+ * メモリ不足などでエラーが発生した場合は、本関数はNULLを返します。 + * + */ + static CriMvEasyPlayer* CRIAPI Create(CriHeap heap, + CriMvFileReaderInterface *freader, + CriMvSystemTimerInterface *stimer, + CriMvSoundInterface *sound, + CriError &err=CriMv::ErrorContainer); + /*EN + * \ingroup MODULE_INIT + * \brief Destroy a handle + * \param err Optional error code + * + * \ingroup MODULE_INIT + * + * \brief Destroys an EasyPlayer handle + * \param err Optional error code + * + * Destroys an EasyPlayer handle previously created with CriMvEasyPlayer::Create(), and frees its resources. + * + * An EasyPlayer handle can only be destroyed when it is in the MVEASY_STATUS_STOP or MVEASY_STATUS_PLAYEND state. + * Attempting to destroy a handle when it is in any other state will cause an error. + * + * Any work buffers allocated via CriHeap, if still associated with the handle, are freed by this call. + * + * \sa CriMvEasyPlayer::Create(), CriMvEasyPlayer::Status, CriMvEasyPlayer::GetStatus() + */ + /*JP + * \ingroup MODULE_INIT + * \brief EasyPlayerハンドルの破棄 + * \param err エラー情報(省略可) + * + * CriMvEasyPlayer::Create()で作成したEasyPlayerハンドルを破棄します。 + * + * ハンドル状態が MVEASY_STATUS_STOP 、 MVEASY_STATUS_PLAYEND の時にのみハンドルを破棄することができます。
+ * それ以外の状態で呼び出した場合は、エラーになります。
+ * + * ハンドル状態が MVEASY_STATUS_ERROR だった場合は、CriMvEasyPlayer::Stop() を呼び出して + * MVEASY_STATUS_STOP 状態になってからハンドル破棄してください。
+ * ハンドル状態は CriMvEasyPlayer::GetStatus() で確認することができます。 + * + * ハンドル作成時に指定したCriHeapによって確保されたメモリで未解放の全ては、 + * この関数の呼び出しによって解放されます。 + * + * \sa CriMvEasyPlayer::Create(), CriMvEasyPlayer::Status, CriMvEasyPlayer::GetStatus() + */ + void Destroy(CriError &err=CriMv::ErrorContainer); + + /*EN + * \ingroup MODULE_BASIC + * + * \brief Returns status of an EasyPlayer handle. + * \param err Optional error code + * \return Handle status + * + * Returns the current status of an EasyPlayer handle. The status will be one of the values + * defined by CriMvEasyPlayer::Status. + * + * \sa CriMvEasyPlayer::Status + */ + /*JP + * \ingroup MODULE_BASIC + * \brief ハンドル状態の取得 + * \param err エラー情報(省略可) + * \return ハンドル状態 CriMvEasyPlayer::Status + * + * ハンドル状態を取得します。 + * + * \sa CriMvEasyPlayer::Status + */ + Status GetStatus(CriError &err=CriMv::ErrorContainer); + + /*EN + * \ingroup MODULE_BASIC + * + * \brief Executes heatbeat functions for an EasyPlayer handle + * \param err Optional error code + * + * Performs regular processing for an EasyPlayer handle, including handoff and parsing of input + * buffers, and audio decoding. Additionally, it checks for situations where the handle state + * should change to one of the values defined by CriMvEasyPlayer::Status, and changes state as + * necessary. + * + * This function and CriMvEasyPlayer::ExecuteDecode() should be called periodically during movie + * playback or when waiting for CriMvEasyPlayer::DecodeHeader() to complete. It takes a relatively + * low CPU load, and should typically be called on every vertical blank. + * + * \remarks + * Note that this function does not perform any video decoding. Decoding is done in + * CriMvEasyPlayer::ExecuteDecode(). + * + * \sa CriMvEasyPlayer::Status, CriMvEasyPlayer::ExecuteDecode(), CriMvEasyPlayer::DecodeHeader() + */ + /*JP + * \ingroup MODULE_BASIC + * \brief EasyPlayerサーバ関数 + * \param err エラー情報(省略可) + * + * ムービのヘッダ解析や入力バッファ制御、オーディオデコード等を行います。
+ * EasyPlayer ハンドルの状態遷移もこの関数で行います。
+ * この関数はビデオのデコードは行いません。そのためCPU負荷はあまり高くなりません。
+ * 本関数はアプリケーションのメインループで毎回呼び出すようにしてください。 + * + * \sa CriMvEasyPlayer::Status + */ + void Update(CriError &err=CriMv::ErrorContainer); + + /*EN + * \ingroup MODULE_BASIC + * + * \brief Synchronizes the master timer of an EasyPlayer handle. + * \param err Optional error code + * + * Synchronizes the timing of video frames to the master timer used by this EasyPlayer handle. + * If the master timer is of type MVEASY_TIMER_AUDIO and the movie does not have audio, + * EasyPlayer will use the system timer that was set when the handle was created. + * + * \sa CriMvEasyPlayer::TimerType, CriMvEasyPlayer::SetMasterTimer(), CriMvSystemTimerInterface + */ + /*JP + * \ingroup MODULE_BASIC + * \brief マスタタイマへの同期 + * \param err エラー情報(省略可) + * + * ムービ再生時刻をマスタタイマに同期させます。
+ * マスタタイマは CriMvEasyPlayer::SetMasterTimer() によって指定されたタイマを使います。
+ * タイマ種別として MVEASY_TIMER_AUDIO が指定されていて、再生するムービにオーディオが + * 含まれていない場合は、ハンドル作成時のシステムタイマを使用します。 + * + * この関数は、ハンドル作成時に指定したシステムタイマインタフェースの + * CriMvSystemTimerInterface::GetTime() を呼び出します。 + * + * \sa CriMvEasyPlayer::TimerType, CriMvEasyPlayer::SetMasterTimer(), CriMvSystemTimerInterface + */ + void SyncMasterTimer(CriError &err=CriMv::ErrorContainer); + + /*EN + * \ingroup MODULE_BASIC + * + * \brief Decodes a video frame + * \param err Optional error code + * \return \a TRUE If the movie is currently in a playback state + * \return \a FALSE If the movie is not playing + * + * Performs the actual video decoding. Each call to this function decodes a single frame. + * It does not return until the frame has been decoded. + * + * Video decoding can impose a very heavy CPU load, so calling this function from an application's + * main thread may cause your application to miss the vertical blank interval. To avoid this situation, + * ExecuteDecode() can be called from a separate, lower-priority thread. See the Mutithreaded Decoding + * tutorial for a full explanation. + * + * The return value describes the movie playback state. If TRUE, the movie is currently playing + * (or decoding the movie header) or ready to play. If FALSE, playback has not yet been started, + * or playback has finished. + * + * If a decoding thread is used, an application must wait until this function returns FALSE before destroying + * the thread. Otherwise, the handle state will not transition to MVEASY_STATUS_STOP or MVEASY_STATUS_PLAYEND, + * and the EasyPlayer handle cannot be destroyed. + * + * \attention + * ExecuteDecode() is the only CRI Movie function that is safe to call from a separate thread. + * No other CRI Movie functions should be considered to be thead-safe. + * + */ + /*JP + * \ingroup MODULE_BASIC + * \brief ビデオデコード + * \param err エラー情報(省略可) + * \return ムービ再生中はTRUE 、再生終了また停止後はFALSEを返します。 + * + * ビデオデータのデコードを行います。
+ * 本関数は1ピクチャ分のデコードを終わるまで終了しません。
+ * ピクチャデコードは負荷の高い処理なので、アプリケーションのメインスレッドから呼び出すと処理落ちが発生する可能性があります。
+ * その場合は、メインスレッドよりも優先度の低い別スレッドから呼び出すようにしてください。 + * + * 本関数の返り値は、ムービ再生の実行中かどうかを表しています。
+ * デコード用スレッドを終了する場合は、返り値がFALSEになるのを待たなければいけません。
+ * 返り値がTRUEの間にデコードスレッドを終了してしまうと、ハンドルの状態が MVEASY_STATUS_STOP や + * MVEASY_STATUS_PLAYEND に遷移できず、ハンドル破棄が出来なくなります。
+ * + */ + CriBool ExecuteDecode(CriError &err=CriMv::ErrorContainer); + + /* 再生制御 */ + /*EN + * \ingroup MODULE_CONTROL + * + * \brief Sets the name of the movie file to play + * \param fname Name of the movie file + * \param err Optional error code + * + * Sets the name of the movie file to play, but does not open the file. The length of the filename + * (including path) is limited to CRIMV_MAX_FILE_NAME characters. EasyPlayer copies this + * string to internal memory, so a temporary variable can be used. + * + * If an application plays the same movie repeatedly, it only needs to call this function once. + * + * Multiple calls to this function will overwrite previous values. Calling CriMvEasyPlayer::SetData() + * will clear any filename set by this function. + * + * \remarks + * This function can only be called when the handle status is MVEASY_STATUS_STOP or MVEASY_STATUS_PLAYEND, + * or from the file request callback. See CriMvEasyPlayer::SetFileRequestCallback() for details. + * + * \remarks + * Calling this function does not open the file. The file is opened by a call to CriMvEasyPlayer::Update(). + * + * \sa CriMvEasyPlayer::SetFileRequestCallback(), CriMvEasyPlayer::SetData() + */ + /*JP + * \ingroup MODULE_CONTROL + * + * \brief 再生ファイルの指定 + * \param fname ムービファイルパス + * \param err エラー情報(省略可) + * + * 再生するムービのファイルパスを設定します。ファイルパスの最大長は CRIMV_MAX_FILE_NAME バイトです。
+ * EasyPlayerは内部でこのファイルパスをコピーするので、引数で渡した文字列は破棄してもかまいません。 + * + * 同じファイルを繰り返し再生する場合は、この関数を再度呼び出す必要はありません。 + * + * この関数を呼び出した直後にもう一度この関数を呼び出すと、前回のファイル情報は新しいファイル情報に上書きされます。 + * CriMvEasyPlayer::SetData()関数を呼び出した場合は、事前に設定したファイル情報がクリアされます。 + * + * \para 備考1: + * この関数はハンドル状態が MVEASY_STATUS_STOP もしくは MVEASY_STATUS_PLAYEND時のみ呼び出し可能です。 + * またはファイル要求コールバック関数内でもこの関数を呼び出すことができます。詳細は CriMvEasyPlayer::SetFileRequestCallback()関数を + * 参照してください。 + * + * \para 備考2: + * この関数の内部ではファイルのオープン要求はしません。ファイルのオープン処理は CriMvEasyPlayer::Update() 関数の中で行われます。 + * + * \sa CriMvEasyPlayer::SetFileRequestCallback(), CriMvEasyPlayer::SetData(), CriMvEasyPlayer::SetFileRange() + */ + void SetFile(CriChar8 *fname, CriError &err=CriMv::ErrorContainer); + + /*EN + * \ingroup MODULE_CONTROL + * + * \brief Sets in-memory movie data + * \param dataptr Pointer to movie data + * \param datasize Size of data, in bytes + * \param err Optional error code + * + * Sets the in-memory data buffer for this EasyPlayer handle to point to the provided buffer, + * but does not attempt to read that buffer. After this call, the memory pointed to by \a dataptr + * belongs to CRI Movie and must remain valid until playback is complete. + * + * If an application plays the same movie data repeatedly, it only needs to call this function once. + * + * Multiple calls to this function will overwrite previous values. Calling CriMvEasyPlayer::SetFile() + * will clear any pointer set by this function. + * + * \remarks + * This function can only be called when the handle status is MVEASY_STATUS_STOP or MVEASY_STATUS_PLAYEND, + * or from the file request callback. See CriMvEasyPlayer::SetFileRequestCallback() for details. + * + * \remarks + * Calling this function does not attempt to reference the memory. The memory read is initiated by a call + * to CriMvEasyPlayer::DecodeHeader(), CriMvEasyPlayer::Prepare() or CriMvEasyPlayer::Start(). + * + * \sa CriMvEasyPlayer::SetFileRequestCallback(), CriMvEasyPlayer::SetFile(), CriMvEasyPlayer::SetFileRange() + */ + /*JP + * \ingroup MODULE_CONTROL + * \brief メモリ上データの指定 + * \param dataptr データポインタ + * \param datasize データサイズ + * \param err エラー情報(省略可) + * + * この関数はEasyPlayerのハンドル状態がMVEASY_STATUS_STOPかMVEASY_STATUS_PLAYENDの時に呼び出してください。
+ * または、ファイル要求コールバックの内部で呼び出すことができます。
+ * + * 本関数を繰り返し呼び出した場合は、メモリ情報は上書きされます。
+ * CriMvEasyPlayer::SetFile()を呼び出した場合は、本関数で指定したメモリ情報はハンドル内から消去されます。 + * + * 同じハンドルで同じムービデータを繰り返し再生する場合は、本関数の呼び出しは省略することができます。 + * + * 指定されたメモリ領域に実際にアクセスするのは、 CriMvEasyPlayer::DecodeHeader(), CriMvEasyPlayer::Prepare(), + * CriMvEasyPlayer::Start() のいずれかが呼び出された時以降です。
+ * + * \sa CriMvEasyPlayer::SetFileRequestCallback(), CriMvEasyPlayer::SetFile(), CriMvEasyPlayer::SetFileRange() + */ + void SetData(CriUint8 *dataptr, CriUint32 datasize, CriError &err=CriMv::ErrorContainer); + + /*EN + * \ingroup MODULE_CONTROL + * \brief Set a pack file and pass offset and range of movie file to an EasyPlayer handle + * \param fname File name string pointer of the pack file + * \param offset offset in byte to movie data in the packing file [in bytes] + * \param range size of movie data from the offset in the packing file [in bytes] + * \param err Optional error code + * + * Sets the name of the pack file that contains the movie file to play. + * EasyPlayer tries to read data from 'offset' through 'range' in the pack file as the movie data. + * Passing a negative value as range, EasyPlayer reads data until the end of the pack file. + * + * The length of file name is limited until CRIMV_MAX_FILE_NAME. + * EasyPlayer handle copies the file name string into the handle. + * You can use a temporary variable as the file name string. + * + * If an application plays the same movie repeatedly, it only needs to call this function once. + * + * Multiple calls to this function will overwrite previous values. Calling CriMvEasyPlayer::SetData() + * will clear any filename set by this function. + * + * \remarks + * This function can only be called when the handle status is MVEASY_STATUS_STOP or MVEASY_STATUS_PLAYEND, + * or from the file request callback. See CriMvEasyPlayer::SetFileRequestCallback() for details. + * + * \remarks + * Calling this function does not open the file. The file is opened by a call to CriMvEasyPlayer::Update(). + * + * \sa CriMvEasyPlayer::SetFileRequestCallback(), CriMvEasyPlayer::SetData(), CriMvEasyPlayer::SetFile() + */ + /*JP + * \ingroup MODULE_CONTROL + * + * \brief 再生したいムービファイルを含むパックファイルの指定 + * \param fname パックファイル名 (パスを含む) + * \param offset パックファイル内のムービデータまでのオフセット (単位: バイト) + * \param range パックファイル内のムービデータのサイズ (単位:バイト) + * \param err エラー情報(省略可) + * + * 再生するムービを含むパックファイルを指定します。引数で指定した offset 位置から range サイズ分までをパックファイル内に含まれるムービデータみなします。 + * rangeに負値を入力するとパックファイルの終端までをムービとして読み込みます。 + * + * パックファイルのファイルパスの最大長は CRIMV_MAX_FILE_NAME バイトです。 + * EasyPlayerは内部でこのファイルパスをコピーするので、引数で渡した文字列は破棄してもかまいません。 + * + * 同じファイルを繰り返し再生する場合は、この関数を再度呼び出す必要はありません。 + * + * この関数を呼び出した直後に、もう一度この関数を呼び出すと、前回のファイル情報は新しいファイル情報に上書きされます。 + * CriMvEasyPlayer::SetData()関数を呼び出した場合は、事前に設定したファイル情報がクリアされます。 + * + * \para 備考1: + * この関数はハンドル状態が MVEASY_STATUS_STOP もしくは MVEASY_STATUS_PLAYEND時のみ呼び出し可能です。 + * またはファイル要求コールバック関数内でもこの関数を呼び出すことができます。詳細は CriMvEasyPlayer::SetFileRequestCallback()関数を + * 参照してください。 + * + * \para 備考2: + * この関数の内部ではファイルのオープン要求はしません。ファイルのオープン処理は CriMvEasyPlayer::Update() 関数の中で行われます。 + * + * \sa CriMvEasyPlayer::SetFileRequestCallback(), CriMvEasyPlayer::SetData(), CriMvEasyPlayer::SetFile() + */ + void SetFileRange(CriChar8 *fname, CriUint64 offset, CriSint64 range, CriError &err=CriMv::ErrorContainer); + + /* 前回のムービデータをもう一度登録する(ファイル要求コールバック関数でのみ呼ぶこと) */ + void SetPreviousDataAgain(CriError &err=CriMv::ErrorContainer); + + /*EN + * \ingroup MODULE_CONTROL + * + * \brief Reads movie header and analyzes movie information + * \param err Optional error code + * + * This function opens the movie file, reads the header, and starts to analyze the movie data. + * It does not start movie playback. + * + * When this function is called, the handle status changes to MVEASY_STATUS_DECHDR. Once EasyPlayer + * has finished reading the header and analyzing the movie, the status changes to MVEASY_STATUS_WAIT_PREP. + * When the status is MVEASY_STATUS_WAIT_PREP, CriMvEasyPlayer::GetMovieInfo() can be successfully called. + * + * To continue playback, call CriMvEasyPlayer::Prepare() or CriMvEasyPlayer::Start() when the handle status + * is MVEASY_STATUS_WAIT_PREP. + * + * \remarks + * This function can only be called when the handle status is MVEASY_STATUS_STOP or MVEASY_STATUS_PLAYEND. + * + * \remarks + * You must either call CriMvEasyPlayer::SetFile() or CriMvEasyPlayer::SetData(), or provide a file request + * callback with CriMvEasyPlayer::SetFileRequestCallback(), before calling this function. + * + * \remarks + * Once this function has been called, CriMvEasyPlayer::ExecuteDecode() and CriMvEasyPlayer::Update() must be + * called periodically in order for this function to have any effect. Otherwise, the handle status will + * never change. + * + * \sa CriMvEasyPlayer::GetStatus(), CriMvEasyPlayer::Prepare(), CriMvEasyPlayer::Start(), + * CriMvEasyPlayer::SetFileRequestCallback(), + * CriMvEasyPlayer::ExecuteDecode(), CriMvEasyPlayer::Update() + */ + /*JP + * \ingroup MODULE_CONTROL + * \brief ムービヘッダ解析 + * \param err エラー情報(省略可) + * + * ムービの再生は開始せず、ヘッダ解析のみ行って待機するための関数です。
+ * この関数を使用してヘッダ解析を事前に済ませることにより、再生開始前にムービの解像度やオーディオの情報を + * 得ることができます。
+ * 本関数を呼び出すと、EasyPlayerのハンドル状態はMVEASY_STATUS_STOP → MVEASY_STATUS_DECHDR と遷移していき、 + * ヘッダ解析が完了するとMVEASY_STATUS_WAIT_PREPとなります。
+ * ムービ情報を取得するには、ハンドル状態がMVEASY_STATUS_WAIT_PREPになったあとに CriMvEasyPlayer::GetMovieInfo() + * を実行してください。
+ * + * ハンドル状態がMVEASY_STATUS_WAIT_PREPの時に、 CriMvEasyPlayer::Prepare() か CriMvEasyPlayer::Start() を + * 呼ぶことで再生処理を続けることができます。
+ * + * 本関数は EasyPlayerのハンドル状態がMVEASY_STATUS_STOPかMVEASY_STATUS_PLAYENDの時に呼び出してください。 + * + * 本関数を呼び出す前に CriMvEasyPlayer::SetFile() か CriMvEasyPlayer::SetData() でムービデータを指定してください。
+ * ただし、ファイル要求コールバック関数を登録している場合は事前のムービデータ設定は省略することだきます。 + * + * \sa CriMvEasyPlayer::GetStatus(), CriMvEasyPlayer::Prepare(), CriMvEasyPlayer::Start(), CriMvEasyPlayer::SetFileRequestCallback() + */ + void DecodeHeader(CriError &err=CriMv::ErrorContainer); + + /*EN + * \ingroup MODULE_CONTROL + * + * \brief Reads movie header, analyzes movie information, and buffers data. + * \param err Optional error code + * + * This function opens the movie file and gets it ready for immediate playback, by reading and analyzing + * the header and decoding and buffering video data. It allows a movie to start playing immediately when + * CriMvEasyPlayer::Start() is called, without an initial delay. + * + * When this function is called, the handle status changes to MVEASY_STATUS_DECHDR. Once EasyPlayer + * has finished reading and analyzing the movie data, the status changes to MVEASY_STATUS_PREP and EasyPlayer + * begins decoding video data. When the initial video data has been decoded and buffered, the status changes to + * MVEASY_STATUS_READY. + * + * The amount of data that is buffered, in seconds, is based on the value set by CriMvEasyPlayer::SetBufferingTime(). + * By default, this is 1 second. + * + * When the status is MVEASY_STATUS_READY, movie playback will start imediately when CriMvEasyPlayer::Start() + * is called. + * + * \remarks + * Unless you CriMvEasyPlayer::DecodeHeader() first, this function can only be called when the handle status + * is MVEASY_STATUS_STOP or MVEASY_STATUS_PLAYEND. + * + * \remarks + * You must either call CriMvEasyPlayer::SetFile() or CriMvEasyPlayer::SetData(), or provide a file request + * callback with CriMvEasyPlayer::SetFileRequestCallback(), before calling this function. + * + * \remarks + * Once this function has been called, CriMvEasyPlayer::ExecuteDecode() and CriMvEasyPlayer::Update() must be + * called periodically in order for this function to have any effect. Otherwise, the handle status will + * never change. + * + * \sa CriMvEasyPlayer::GetStatus(), CriMvEasyPlayer::DecodeHeader(), CriMvEasyPlayer::Start(), + * CriMvEasyPlayer::SetBufferingTime(), CriMvInputBufferInfo + */ + /*JP + * \ingroup MODULE_CONTROL + * \brief 再生準備(ヘッダ解析とバッファリング) + * \param err エラー情報(省略可) + * + * ムービの再生は開始せず、ヘッダ解析と再生準備のみを行って待機するための関数です。
+ * この関数を使用して再生準備を事前に済ませることにより、ムービ再生開始のタイミングを細かく制御することができます。
+ * (再生準備無しで再生開始関数を呼び出した場合は、実際に再生が始まるまでにタイムラグが発生します。)
+ * 本関数を呼び出すと、EasyPlayerのハンドル状態はMVEASY_STATUS_STOP → MVEASY_STATUS_DECHDR → MVEASY_STATUS_PREP と遷移していき、 + * 再生準備が完了するとMVEASY_STATUS_READYとなります。 + * + * ハンドル状態がMVEASY_STATUS_READYの時に、 CriMvEasyPlayer::Start() を呼ぶことで再生を開始することができます。 + * + * CriMvEasyPlayer::DecodeHeader() の呼び出し無しでこの関数を呼び出す場合は、CriMvEasyPlayerのハンドル状態が + * MVEASY_STATUS_STOPかMVEASY_STATUS_PLAYEND でなければいけません。 + * + * 再生開始前には CriMvEasyPlayer::SetFile() か CriMvEasyPlayer::SetData() でムービデータを指定してください。
+ * ただし、ファイル要求コールバック関数を登録している場合は事前のムービデータ設定は省略することだきます。 + * + * \sa CriMvEasyPlayer::GetStatus(), CriMvEasyPlayer::DecodeHeader(), CriMvEasyPlayer::Start(), + * CriMvEasyPlayer::SetBufferingTime(), CriMvInputBufferInfo + */ + void Prepare(CriError &err=CriMv::ErrorContainer); + + /*EN + * \ingroup MODULE_CONTROL + * + * \brief Starts movie playback + * \param err Optional error code + * + * Opens the movie and starts playback. If CriMvEasyPlayer::Prepare() was not called, there will be a + * delay while the library reads the movie header and buffers the initial data. If CriMvEasyPlayer::Prepare() + * was called and the handle status is MVEASY_STATUS_READY, playback will start as soon as this function is called. + * + * \remarks + * If you call this function without calling CriMvEasyPlayer::DecodeHeader() or CriMvEasyPlayer::Prepare() + * first, this function can only be called when the handle status is MVEASY_STATUS_STOP, MVEASY_STATUS_PLAYEND, + * or MVEASY_STATUS_READY. + * + * \remarks + * You must either call CriMvEasyPlayer::SetFile() or CriMvEasyPlayer::SetData(), or provide a file request + * callback with CriMvEasyPlayer::SetFileRequestCallback(), before calling this function. + * + * \remarks + * Once this function has been called, CriMvEasyPlayer::ExecuteDecode() and CriMvEasyPlayer::Update() must be + * called periodically in order for this function to have any effect. Otherwise, the movie will not play and + * the handle status will never change. + * + * \sa CriMvEasyPlayer::GetStatus(), CriMvEasyPlayer::DecodeHeader(), CriMvEasyPlayer::Prepare() + */ + /*JP + * \ingroup MODULE_CONTROL + * \brief 再生開始 + * \param err エラー情報(省略可) + * + * ムービの再生を開始します。
+ * CriMvEasyPlayer::Prepare()を呼ばずに、本関数を呼び出した場合は、ムービの解析と再生の準備を行うため、 + * 実際にムービの再生が始まるまでにタイムラグが発生します。
+ * CriMvEasyPlayer::Prepare()を先に呼び出して、ハンドル状態がMVEASY_STATUS_READYになっていれば、 + * この関数を呼び出してすぐに再生が始まります。 + * + * CriMvEasyPlayer::DecodeHeader() または CriMvEasyPlayer::Prepare() の呼び出し無しでこの関数を呼び出す場合は、 + * CriMvEasyPlayerのハンドル状態が MVEASY_STATUS_STOPかMVEASY_STATUS_PLAYEND でなければいけません。 + * + * 再生開始前には CriMvEasyPlayer::SetFile() か CriMvEasyPlayer::SetData() でムービデータを指定してください。
+ * ただし、ファイル要求コールバック関数を登録している場合は事前のムービデータ設定は省略することだきます。 + * + * \sa CriMvEasyPlayer::GetStatus(), CriMvEasyPlayer::DecodeHeader(), CriMvEasyPlayer::Prepare() + */ + void Start(CriError &err=CriMv::ErrorContainer); + + /*EN + * \ingroup MODULE_CONTROL + * + * \brief Stops movie playback; resets a handle that is in an ERROR state, + * \param err Optional error code + * + * Tells the movie to stop playing and returns immediately. Note that this does not actually stop playback; + * an application must continue to call CriMvEasyPlayer::Update() and CriMvEasyPlayer::ExecuteDecode() until + * the status changes to MVEASY_STATUS_STOP. + * + * Once the handle is in the MVEASY_STATUS_STOP state, it can be reused for a different movie. + * + * If the handle state is MVEASY_STATUS_ERROR, an application must call this function and wait for the status + * to change to MVEASY_STATUS_STOP before destroying or reusing the player handle. + * + * In principle, this function does not reset any EasyPlayer handle parameters that were explicitly set via + * any of the settings APIs, so an application can replay the same movie by simply calling CriMvEasyPlayer::Start() + * once the state has changed to MVEASY_STATUS_STOP. However, calling this function will reset the following + * parameters: + * + * - The pause state (see CriMvEasyPlayer::Pause()) will be reset to OFF (not paused). + * - If a file request callback has been set (via CriMvEasyPlayer::SetFileRequestCallback()), the movie + * data information will be reset. + * + * See the description of CriMvEasyPlayer::ResetAllParameters() for a comparison of the parameters that are + * affected by that function and by this function. + * + * \remarks + * This function may call CriMvSoundInterface::Stop() and CriMvFileReaderInterface::Close(). For an EasyPlayer + * handle to change to MVEASY_STATUS_STOP, the sound and file interfaces need to transition to their STOP states. + * In the case of CriMvSoundInterface, this means that CriMvSoundInterface::GetStatus() will return + * MVEASY_SOUND_STATUS_STOP. For CriMvFileReaderInterface, this means that CriMvFileReaderInterface::GetCloseStatus() + * will return ASYNC_STATUS_COMPLETE. + * + * \sa CriMvEasyPlayer::Status, CriMvEasyPlayer::GetStatus(), CriMvEasyPlayer::ResetAllParameters() + */ + /*JP + * \ingroup MODULE_CONTROL + * \brief 再生停止/エラー状態からの復帰 + * \param err エラー情報(省略可) + * + * ムービ再生停止の要求を出します。本関数は即時復帰関数です。本関数内で全ての停止処理が実行されるわけではありません。
+ * 本関数呼出し後、再生状態が MVEASY_STATUS_STOP なるまでは通常のメインループ処理を動かしてください。
+ * 具体的には CriMvEasyPlayer::Update(), CriMvEasyPlayer::ExecuteDecode() が通常通り呼び出される必要があります。 + * + * 再生状態が MVEASY_STATUS_ERROR になった場合は、本関数を呼び出して MVEASY_STATUS_STOP を待ってください。
+ * + * forループなどによるローカルループで状態変更待ちをしても MVEASY_STATUS_STOP にはなりません。
+ * + * 本関数を呼び出しても、アプリケーションが再生ハンドルに設定した各種パラメータは原則としてリセットされません。
+ * MVEASY_STATUS_STOP 状態になったあと、もう一度再生を開始すると前回と同じパラメータで再生を行うことができます。
+ * 例外的に本関数でリセットされるパラメータは以下のものがあります。 + * - CriMvEasyPlayer::Pause() によるポーズ状態は、OFFにリセットされます。 + * - ファイル要求コールバック関数の登録がある場合、ムービファイル名(またはメモリ)の情報はリセットされます。 + * + * リセットされるパラメータ一覧は CriMvEasyPlayer::ResetAllParameters() の説明を参照してください。 + * + * 本関数は必要に応じて CriMvSoundInterface::Stop() および CriMvFileReaderInterface::Close() を呼び出します。
+ * EasyPlayer ハンドルが MVEASY_STATUS_STOP 状態になるためには、各インタフェースが停止状態にならなければいけません。
+ * サウンドインタフェースの場合、 CriMvSoundInterface::GetStatus()が MVEASY_SOUND_STATUS_STOP を返すこと。
+ * ファイル読み込みインタフェースの場合、 CriMvFileReaderInterface::GetCloseStatus() が、ASYNC_STATUS_COMPLETE + * を返さなければいけません。 + * + * \sa CriMvEasyPlayer::Status, CriMvEasyPlayer::GetStatus(), CriMvEasyPlayer::ResetAllParameters() + */ + void Stop(CriError &err=CriMv::ErrorContainer); + + /*EN + * \ingroup MODULE_CONTROL + * + * \brief Pauses or resumes movie playback + * \param sw Pause state. ON (1) will pause playback, OFF (0) will resume it. + * \param err Optional error code + * + * Pauses or resumes movie playback, depending on the argument. If \a sw is ON (1), playback will be paused. + * If \a sw is OFF (0), playback will be resumed. + * + * \remarks + * This function will call CriMvSoundInterface::Pause() and CriMvSystemTimerInterface::Pause() with the + * provided argument. + * + * \remarks + * Calling CriMvEasyPlayer::Stop() or CriMvEasyPlayer::ResetAllParameters() will set the pause state to OFF. + * + * \sa CriMvSoundInterface::Pause(), CriMvSystemTimerInterface::Pause() + */ + /*JP + * \ingroup MODULE_CONTROL + * \brief 再生の一時停止または再開 + * \param sw ポーズスイッチ。ポーズONの場合は1、ポーズOFF(レジューム)の場合は0を指定します。 + * \param err エラー情報(省略可) + * + * 本関数の動作は引数に依存します。
+ * 引数 sw がON(1)なら、一時停止。引数 sw がOFF(0)なら再生再開です。 + * + * CriMvEasyPlayer::Stop() または CriMvEasyPlayer::ResetAllParameters を呼び出すとポーズ状態はOFFにリセットされます。 + * + * この関数は CriMvSoundInterface::Pause() と CriMvSystemTimerInterface::Pause() を同じ引数で呼び出します。 + * + * \sa CriMvSoundInterface::Pause(), CriMvSystemTimerInterface::Pause() + */ + void Pause(CriBool sw, CriError &err=CriMv::ErrorContainer); + + CriBool IsPaused(CriError &err=CriMv::ErrorContainer); + + /* オプション設定/取得 */ + /*EN + * \ingroup MODULE_OPTION + * + * \brief Sets the type of timer used for video synchronization + * \param type Type of timer to use + * \param err Optional error code + * + * In order to display video frames at the proper rate, CRI Movie uses a timer to determine when the + * next frame should be shown. For a movie with an audio track, you would typically use the + * MVEASY_TIMER_AUDIO timer type. For a movie with no audio, the MVEASY_TIMER_SYSTEM type timer + * should be used. + * + * The default is the timer type that was passed to CriMvEasyPlayer::Create(). If this value + * was NULL, a system timer (MVEASY_TIMER_SYSTEM) will be used. + * + * \remarks + * If an audio timer (MVEASY_TIMER_AUDIO) is wanted, it must be created and passed to + * CriMvEasyPlayer::Create(). + * + * \remarks + * If the movie does not have an audio track, CRI Movie will use a MVEASY_TIMER_SYSTEM regardless of + * the value set by this function. + * + * \sa CriMvEasyPlayer::GetMasterTimer(), CriMvEasyPlayer::Create(), TimerType + */ + /*JP + * \ingroup MODULE_OPTION + * \brief マスタタイマ種別の指定 + * \param type マスタタイマ種別 + * \param err エラー情報(省略可) + * + * ビデオフレームの時刻管理に使用するタイマ種別を指定します。
+ * デフォルトはハンドル作成時に指定するシステムタイマです。
+ * ビデオフレームの表示タイミングをオーディオの時刻と同期させたいときはオーディオタイマを指定してください。
+ * オーディオタイマを指定した場合でも、再生するムービにオーディオが含まれていない場合はシステムタイマ同期となります。 + * + * \sa CriMvEasyPlayer::GetMasterTimer(), CriMvEasyPlayer::Create() + */ + void SetMasterTimer(TimerType type, CriError &err=CriMv::ErrorContainer); // default is SYSTEM + + /*EN + * \ingroup MODULE_OPTION + * + * \brief Returns the type of timer currently being used by the EasyPlayer handle + * \param err Optional error code + * \return The current timer type + * + * Returns the current type of timer used to synchronize video frames. This value can be changed + * by calling CriMvEasyPlayer::SetMasterTimer(). Otherwise, the timer type is set when the handle + * is created. + * + * \sa CriMvEasyPlayer::SetMasterTimer(), CriMvEasyPlayer::Create(), TimerType + */ + /*JP + * \ingroup MODULE_OPTION + * \brief マスタタイマ種別の取得 + * \param err エラー情報(省略可) + * \return 現在設定されているマスタタイマ種別 + * + * 現在設定されているマスタタイマ種別を取得します。 + * + * \sa CriMvEasyPlayer::SetMasterTimer() + */ + TimerType GetMasterTimer(CriError &err=CriMv::ErrorContainer); + + /*EN + * \ingroup MODULE_OPTION + * + * \brief Sets the number of internal video buffers + * \param npools The number of buffers to use; must be greater than 0 + * \param err Optional error code + * + * CRI Movie uses internal memory, or frame pools, to buffer decoded frames before display. + * More frame pools can help smooth out playback under high CPU loads. + * + * \remarks + * By default, the number of pools is 1. To change the value, this function must be called + * before starting playback (with either CriMvEasyPlayer::Prepare() or CriMvEasyPlayer::Start()). + */ + /*JP + * \ingroup MODULE_OPTION + * \brief 内部ビデオバッファ(フレームプール)数の指定 + * \param npools 内部ビデオバッファ数(最低でも1) + * \param err エラー情報(省略可) + * + * EasyPlayerハンドル内部のビデオバッファ数を指定します。
+ * この内部ビデオバッファはデコード結果を蓄えておくためのもので、フレームプールと呼びます。
+ * フレームプールが多いほど先行してビデオデコードを進めることができるため、デコードの + * 負荷変動が大きかったり、デコードに使用できるCPU時間の変動が大きい場合にもスムーズな再生を + * 行いやすくなります。
+ * デフォルトのフレームプール数は1です。
+ * フレームプール数を変更したい場合は、再生開始前( CriMvEasyPlayer::Prepare()または CriMvEasyPlayer::Start())に + * 本関数を実行してください。 + */ + void SetNumberOfFramePools(CriUint32 npools, CriError &err=CriMv::ErrorContainer); + + /*EN + * \ingroup MODULE_OPTION + * + * \brief Sets the amount of movie data that will be buffered, in seconds + * \param sec Buffering time, in seconds + * \param err Optional error code + * + * CRI Movie buffers enough raw data from disk to allow for smooth playback and to reduce disk reads. + * The buffer size is based on the bitrate of the movie, and other movie parameters. + * + * By default, this buffer will be large enough to hold 1 second worth of playback. + * + * To determine the current buffering time, look at the \a buffering_time field of the + * CriMvStreamingParameters structure, which is retrieved by calling CriMvEasyPlayer::GetMovieInfo(). + * + * \remarks + * If this function is called, it must be called before starting playback (with either + * CriMvEasyPlayer::Prepare() or CriMvEasyPlayer::Start()). + * + * \remarks + * Passing \a 0.0 as the value of \a sec will reset the buffering time to the default value. + * + * \remarks + * If an application calls CriMvEasyPlayer::SetStreamingParameters() for a handle, this function + * can not be used with that handle. + * + * \remarks + * The value set by this function, along with the value set by CriMvEasyPlayer::SetReloadThresholdTime(), + * determine how often data is read from disk. See the description of + * CriMvEasyPlayer::SetReloadThresholdTime() for details. + * + * \sa CriMvEasyPlayer::SetReloadThresholdTime(), CriMvEasyPlayer::GetInputBufferInfo(), + * CriMvStreamingParameters + */ + /*JP + * \ingroup MODULE_OPTION + * \brief 入力データのバッファリング時間の指定 + * \param sec バッファリング時間。単位は秒。 + * \param err エラー情報(省略可) + * + * ストリーミング再生でバッファリングする入力データの量を秒単位の時間で指定します。
+ * EasyPlayerは、バッファリング時間とムービのビットレート等から読み込みバッファのサイズを決定します。 + * + * デフォルトのバッファリング時間は、再生開始時点でアプリケーションが作成済みのEasyPlayerハンドル数 + * に依存して決まります。EasyPlayerハンドル1つにつき1秒のバッファリング時間を確保します。もしもアプリ + * ケーションが3つのEasyPlayerハンドルを作成していた場合、バッファリング時間は3秒となります。 + * + * EasyPlayerハンドルが何秒分のバッファリング時間になっているかは CriMvEasyPlayer::GetMovieInfo + * 関数で取得する CriMvStreamingParameters 構造体の変数 buffering_time で確認できます。 + * + * 本関数の呼び出しは、 CriMvEasyPlayer::Prepare 関数または CriMvEasyPlayer::Start 関数の前までに実行してください。 + * + * バッファリング時間に 0.0f を指定した場合、バッファリング時間はライブラリのデフォルト値となります。
+ * また、アプリケーションが CriMvEasyPlayer::SetStreamingParameters 関数を呼び出した場合は本関数で + * 設定した値よりも、 CriMvEasyPlayer::SetStreamingParameters 関数の指定が優先されます。 + * + * \sa CriMvEasyPlayer::SetReloadThresholdTime(), CriMvEasyPlayer::GetInputBufferInfo() + */ + void SetBufferingTime(CriFloat32 sec, CriError &err=CriMv::ErrorContainer); + + /*EN + * \ingroup MODULE_OPTION + * + * \brief Determines how often the movie data buffer is refilled from disk + * \param sec Number of seconds of playback time to buffer + * \param err Optional error code + * + * EasyPlayer buffers raw data from disk to allow for smooth playback. How often it refills + * its buffers is determined by this function. When the amount of data remaining, in seconds, + * falls below this value, EasyPlayer will call into the FileReader module for this handle in + * order to read more data. + * + * SetBufferingTime() sets a "low water mark" for the data buffer. For instance, if an application + * sets the buffer size to 4 seconds (with CriMvEasyPlayer::SetBufferingTime()), and sets the reload + * threshold to 1 second, then CRI Movie will initially fill the buffer with 4 seconds worth of + * data. After 3 seconds worth of data have been decoded and consumed, there will be less than + * \a reload \a threshold seconds of data remaining, and CRI Movie will refill the buffer. + * + * \remarks + * The default value for \a sec is 0.8s. + * + * \remarks + * If this function is called, it must be called before starting playback (with either + * CriMvEasyPlayer::Prepare() or CriMvEasyPlayer::Start()). + * + * \sa CriMvEasyPlayer::SetBufferingTime(), CriMvEasyPlayer::GetInputBufferInfo(), CriMvFileReaderInterface + */ + /*JP + * \ingroup MODULE_OPTION + * \brief 再読み込み閾値の時間指定 + * \param sec 時間指定による再読み込み閾値。単位は秒。 + * \param err エラー情報(省略可) + * + * EasyPlayerハンドルは、入力バッファ内のデータが再読み込み閾値以下になった時に次のデータ読み込みを実行します。 + * 再読み込み閾値は本関数による指定時間とムービデータのビットレートによって自動的に計算されます。 + * 再読み込み閾値は時間[秒]で指定します。デフォルト値は0.8秒です。 + * + * ムービ再生中にデータを裏読みする場合などにシーク回数を減らすために閾値設定を利用することができます。 + * 例えば、バッファリング時間を2秒、再読み込み閾値を1秒に設定すると、ムービデータの読み込みは約1秒に1回の実行になります。 + * こうすることで、約1秒の間はデータの読み込みを連続的に行うことができます。 + * + * ムービを再生しながらユーザデータの読み込みを行う場合、ユーザデータの読み込みは本関数で指定した時間以内に読み込み + * 処理が終わるようにしてください。サイズの大きなデータは複数に分割して読み込むなどの対処が必要になります。 + * 本関数で指定した時間以内にユーザデータの読み込みが終わらなかった場合、ムービデータが枯渇してムービ再生が滞ります。 + * + * 本関数の呼び出しは、 CriMvEasyPlayer::Prepare 関数または CriMvEasyPlayer::Start 関数の前までに実行してください。 + * + * ムービ再生中の入力バッファのデータ量や再読み込み閾値のサイズは、CriMvEasyPlayer::GetInputBufferInfo で取得可能です。 + * + * \sa CriMvEasyPlayer::SetBufferingTime(), CriMvEasyPlayer::GetInputBufferInfo() + */ + void SetReloadThresholdTime(CriFloat32 sec, CriError &err=CriMv::ErrorContainer); + + /*EN + * \ingroup MODULE_OPTION + * + * \brief Retrieves input data buffering settings + * \param ibuf_info Input buffer information structure + * \param err Optional error code + * + * Populates the passed CriMvInputBufferInfo structure with the values of the settings + * for the raw input buffer size, the reload interval, and the amount of data currently buffered. + * + * \remarks + * This function can be called once the handle status has transitioned to MVEASY_STATUS_WAIT_PREP. + * + * \sa CriMvInputBufferInfo, CriMvEasyPlayer::SetBufferingTime(), CriMvEasyPlayer::SetReloadThresholdTime() + */ + /*JP + * \ingroup MODULE_OPTION + * \brief 入力バッファ情報の取得 + * \param ibuf_info 入力バッファ情報 + * \param err エラー情報(省略可) + * + * 入力バッファ情報 CriMvInputBufferInfo を取得します。
+ * 入力バッファ情報はEasyPlayerハンドルの状態が MVEASY_STATUS_WAIT_PREP 以降になったあと取得できます。
+ * + * \sa CriMvInputBufferInfo, CriMvEasyPlayer::SetBufferingTime(), CriMvEasyPlayer::SetReloadThresholdTime() + */ + void GetInputBufferInfo(CriMvInputBufferInfo &ibuf_info, CriError &err=CriMv::ErrorContainer); + + /*EN + * + * \brief Sets the maximum bitrate EasyPlayer will assume for movie data + * \param max_bitrate Maximum bitrate, in bits/second + * \param err Optional error code + * + * EasyPlayer determines the size of its input data buffer by the movie's bitrate, the buffering time, + * and other movie parameters. In normal usage, an application should not need to call this function. + * However, it can be useful when doing concatenated playback of several movies sequentially. + * + * If the bitrate of the first movie is smaller or larger than the next movie, EasyPlayer can choose + * a buffer size that will be appropriate for the first movie, but either too small for the next + * (causing excessive disk reads or playback stuttering) or too large (using more memory than necessary). + * + * Passing a value of 0 for \a max_bitrate will cause the handle to revert to its default behavior + * for determining maximum bitrate. + * + * \remarks + * The value set by this function will not be reflected in the \a max_bitrate field of the + * CriMvStreamingParameters structure, which will contain the actual value as stored in the movie's + * header. + * + * \remarks + * If this function is called, it must be called before starting playback (with either + * CriMvEasyPlayer::Prepare() or CriMvEasyPlayer::Start()). + * + * \remarks + * If an application calls CriMvEasyPlayer::SetStreamingParameters() for a handle, this function + * can not be used with that handle. + * + * \remarks + * For details about concatenated playback, see the description of CriMvEasyPlayer::SetFileRequestCallback(). + * + * \sa CriMvEasyPlayer::SetBufferingTime(), CriMvEasyPlayer::SetReloadThresholdTime(), + * CriMvEasyPlayer::SetFileRequestCallback() + */ + /*JP + * \ingroup MODULE_OPTION + * \brief 最大ビットレートの指定 + * \param max_bitrate 最大ビットレート(bit per second) + * \param err エラー情報(省略可) + * + * ムービデータの最大ビットレートを指定します。最大ビットレートはストリーム再生用に確保するバッファサイズに影響します。
+ * + * 単純再生時は本関数を呼び出す必要はありません。EasyPlayerハンドルが自動的に最大ビットレートを取得して必要なだけの + * 読み込みバッファを確保します。
+ * + * 連結再生時に、先頭のムービファイルのビットレートが後続のムービファイルと比べて極端に小さい場合には、本関数を使用して + * 明示的に最大ビットレートを大きく指定してください。
+ * + * 本関数で設定した最大ビットレートは、CriMvEasyPlayer::GetMovieInfo 関数で取得するムービ情報には反映されません。 + * CriMvEasyPlayer::GetMovieInfo 関数で取得できるのはムービデータの本来の情報です。
+ * + * 本関数の呼び出しは、 CriMvEasyPlayer::Prepare 関数または CriMvEasyPlayer::Start 関数の前までに実行してください。
+ * + * 最大ビットレートに 0を指定した場合、最大ビットレートはムービデータの持つ値となります。
+ * また、アプリケーションが CriMvEasyPlayer::SetStreamingParameters 関数を呼び出した場合は本関数で + * 設定した値よりも、 CriMvEasyPlayer::SetStreamingParameters 関数の指定が優先されます。 + * + * \sa CriMvEasyPlayer::SetBufferingTime(), CriMvEasyPlayer::SetReloadThresholdTime(), + * CriMvEasyPlayer::SetFileRequestCallback() + */ + void SetMaxBitrate(CriUint32 max_bitrate, CriError &err=CriMv::ErrorContainer); + + /*EN + * \ingroup MODULE_OPTION + * + * \brief Sets the audio playback track + * \param track Audio track number + * \param err Optional error code + * + * If a movie has multiple audio tracks (for instance, English and Spanish versions), this function + * will determine which track plays. By default, the first audio track is used. + * + * To determine the number of audio tracks in the movie, call CriMvEasyPlayer::GetMovieInfo() and + * look at the \a num_audio field of the CriMvStreamingParameters structure. + * + * If the movie does not have any audio, this function has no effect. + * + * \remarks + * To use the default setting, set \a track to CRIMV_AUDIO_TRACK_AUTO. + * + * \remarks + * To turn off audio altogether, set \a track to CRIMV_AUDIO_TRACK_OFF. + * + * \sa CriMvEasyPlayer::GetMovieInfo() + */ + /*JP + * \ingroup MODULE_OPTION + * \brief 再生するオーディオトラックの指定 + * \param track 再生するオーディオトラック + * \param err エラー情報(省略可) + * + * ムービが複数のオーディオトラックを持っている場合に、再生するオーディオを指定します。
+ * 再生開始前( CriMvEasyPlayer::Prepare()または CriMvEasyPlayer::Start())に本関数を実行してください。 + * + * 本関数を実行しなかった場合は、もっとも若い番号のオーディオトラックを再生します。
+ * CriMvEasyPlayer::DecodeHeader()と CriMvEasyPlayer::GetMovieInfo()を使うことで、どのチャネルに + * どんなオーディオが入っているかを再生開始前に知ることができます。 + * + * データが存在しないトラック番号を指定した場合は、オーディオは再生されません。 + * + * トラック番号としてCRIMV_AUDIO_TRACK_OFFを指定すると、例えムービにオーディオが含まれていたと + * してもオーディオは再生しません。 + * + * また、デフォルト設定(もっとも若いチャネルのオーディオを再生する)にしたい場合は、 + * チャネルとしてCRIMV_AUDIO_TRACK_AUTOを指定してください。 + * + * \sa CriMvEasyPlayer::GetMovieInfo(), CriMvEasyPlayer::DecodeHeader() + */ + void SetAudioTrack(CriSint32 track, CriError &err=CriMv::ErrorContainer); + + /*EN + * \ingroup MODULE_OPTION + * + * \brief Turns movie looping on or off + * \param sw Looping value + * \param err Optional error code + * + * If \a sw is 1 (ON), the movie will loop continuously. + * If \a sw is 0 (OFF), the movie will play normally. + * + * In normal usage, a movie will play once, with the handle status changing to MVEASY_STATUS_PLAYEND + * when it completes. When looping is ON, this behavior changes. When the movie reaches the + * end, it will immediately start playing again from the beginning, and the status will continue to + * toggle between MVEASY_STATUS_PLAYING and MVEASY_STATUS_PREP. + * + * If looping is ON, and the playback is from a file, EasyPlayer will call CriMvFileReaderInterface::Seek() + * as necessary to reset the file pointer. + * + * \remarks + * If looping is ON, and an application sets it to OFF while the movie is playing, playback might + * not stop at the end of the movie. In that case, playback will end after the next loop iteration. + * + * \sa CriMvEasyPlayer::GetLoopFlag(), CriMvFileReaderInterface::Seek() + */ + /*JP + * \ingroup MODULE_OPTION + * \brief ループ再生フラグの指定 + * \param sw ループスイッチ。ONの場合はループあり、OFFの場合はループ無しになります。 + * \param err エラー情報(省略可) + * + * ループ再生の有無を設定します。デフォルトはループOFFです。
+ * ループ再生ONにした場合は、ムービの終端まで再生してもハンドル状態はMVEASY_STATUS_PLAYENDにならず、 + * ムービの先頭から再生を繰り返します。
+ * ファイル名指定で再生している場合は、最後まで読み込んだあと CriMvFileReaderInterface::Seek()を使って + * 読み込み位置をファイルの先頭に戻します。 + * + * ループ再生OFFに設定した場合は、そのとき読み込んでいたムービの終端まで再生すると、 + * ハンドル状態がMVEASY_STATUS_PLAYENDに遷移します。
+ * 再生中にループOFFにした場合、タイミングによっては、再生中のムービ終端で終わらず、次の繰り返し + * 再生まで実行されます。 + * + * 現在のループ設定を取得するには CriMvEasyPlayer::GetLoopFlag()を使ってください。 + * + * \sa CriMvEasyPlayer::GetLoopFlag(), CriMvFileReaderInterface::Seek() + */ + void SetLoopFlag(CriBool sw, CriError &err=CriMv::ErrorContainer); + + /*EN + * \ingroup MODULE_OPTION + * + * \brief Retrieves the value of the looping flag + * \return The current looping setting + * + * By default, looping is OFF and playback will stop when it reaches the end. You can + * change this behavior by calling CriMvEasyPlayer::SetLoopFlag(). + * + * \sa CriMvEasyPlayer::SetLoopFlag() + */ + /*JP + * \ingroup MODULE_OPTION + * \brief ループ再生フラグの取得 + * \param err エラー情報(省略可) + * \return 現在のループ再生設定 + * + * 現在のループ設定を取得します。 + * ループ設定は CriMvEasyPlayer::SetLoopFlag() で変更することができます。 + * + * \sa CriMvEasyPlayer::SetLoopFlag() + */ + CriBool GetLoopFlag(CriError &err=CriMv::ErrorContainer); + + /*EN + * \ingroup MODULE_OPTION + * + * \brief Gets the amount of time that a movie has been playing + * \param count Number of timer units since the movie started playing + * \param unit Number of timer units per second + * \param err Optional error code + * + * This function retrieves the absolute time that has elapsed since a movie started playing. + * The time value is returned in two parts - a counter with an arbitrary interval, and the + * number of timer ticks per second. To determine the playing time in seconds, divide + * \a count by \a unit. + * + * Before playback has started, and after it has stopped, this function will return a \a count value of 0. + * + * The value retrieved is the value of the master timer for the handle, not the time of the current frame itself. + * To get the video frame time, check the CriMvFrameInfo structure once you have retrieved the frame. + * + * \remarks + * Note that this function provides an absolute playback time - it does not wrap to 0 + * when the movie loops. + * + */ + /*JP + * \ingroup MODULE_OPTION + * \brief 再生時刻の取得 + * \param count タイマカウント + * \param unit 1秒あたりのタイマカウント値。count ÷ unit で秒単位の時刻となります。 + * \param err エラー情報(省略可) + * + * タイマ時刻を取得します。時刻はcountとunitの二つの変数で表現します。
+ * count ÷ unit で秒単位の時刻となるような値を返します。
+ * 再生開始前( CriMvSoundInterface::Start()呼び出し前)および + * 再生停止後( CriMvSoundInterface::Stop()呼び出し後)は、時刻0(タイマカウントが0)を返します。
+ * 本関数はマスタタイマで指定されたタイマの時刻を返すだけで、ビデオフレームの時刻を返すものではありません。
+ * 取得したビデオフレームの本来の表示時刻は、ビデオフレーム取得時の CriMvFrameInfo 構造体を参照してください。 + */ + void GetTime(CriUint64 &count, CriUint64 &unit, CriError &err=CriMv::ErrorContainer); // only refer time of SyncMasterTimer + + /*EN + * \ingroup MODULE_OPTION + * + * \brief Gets information about the movie + * \param stmprm Movie information structure + * \param err Optional error code + * \return TRUE if movie information was successfully retrieved + * \return FALSE if the header has not yet been decoded, or if an error occurred + * + * Populates the passed \a CriMvStreamingParameters structure with information about the current movie, + * including the bitrate, resolution, audio track information, subtitle availability, and more. + * + * This function is available once the handle status has changed to MVEASY_STATUS_WAIT_PREP. If an application + * needs this information before starting playback (for instance, to set up for playing subtitles, or to + * allocate a display surface based on the size of the movie), call CriMvEasyPlayer::DecodeHeader(), then + * call GetMovieInfo(). + * + * \remarks + * When doing concatenated playback (via CriMvEasyPlayer::SetFileRequestCallback()), GetMovieInfo() will + * return information about the currently playing movie. + * + * \sa CriMvEasyPlayer::DecodeHeader(), CriMvEasyPlayer::SetFileRequestCallback() + */ + /*JP + * \ingroup MODULE_OPTION + * \brief ムービ情報の取得 + * \param stmprm ムービ情報 + * \param err エラー情報(省略可) + * + * ムービ情報 CriMvStreamingParameters を取得します。
+ * ムービ情報からは主にビットレートや解像度、オーディオ数などがわかります。
+ * ムービ情報はEasyPlayerハンドルの状態が MVEASY_STATUS_WAIT_PREP 以降になったあと取得できます。
+ * 再生開始前にムービ情報を知りたい場合は、 CriMvEasyPlayer::DecodeHeader()を呼び出してヘッダ解析を行ってください。 + * + * 連結再生を行った場合、最後に取得したフレームを含むムービファイルについての情報を返します。 + * + * \sa CriMvEasyPlayer::DecodeHeader() + */ + CriBool GetMovieInfo(CriMvStreamingParameters &stmprm, CriError &err=CriMv::ErrorContainer); + + /*EN + * \ingroup MODULE_OPTION + * + * \brief Changes the parameters for the movie + * \param stmprm Movie information structure + * \param err Optional error code + * + * This is a DEBUG function and should not normally be used by applications. + * + * This function allows an application to change the streaming parameters for the movie as a whole. + * It is available once the handle status has changed to MVEASY_STATUS_WAIT_PREP. + * + * To use this function, first call CriMvEasyPlayer::DecodeHeader(), then call CriMvEasyPlayer::GetMovieInfo() + * to retrieve the current movie parameters. Change the fields of the CriMvStreamingParameters structure + * as appropriate, then call SetStreamingParameters(). + * + * \sa CriMvEasyPlayer::GetMovieInfo(), CriMvEasyPlayer::DecodeHeader() + */ + /*JP + * \ingroup MODULE_OPTION + * \brief ストリーミングパラメータの変更 + * \param stmprm ストリーミングパラメータ + * \param err エラー情報(省略可) + * + * 本関数は通常、アプリケーションからは使用しません。デバッグ用の関数です。 + * + * ムービ再生のためのストリーミングパラメータをEasyPlayerハンドルに設定します。
+ * ストリーミングパラメータが指定できるのは、EasyPlayerハンドル状態がMVEASY_STATUS_WAIT_PREPの時だけです。
+ * この関数は、読み込みバッファサイズなど細かなパラメータを全てアプリケーションで調整したい場合に使います。
+ * CriMvEasyPlayer::DecodeHeader()でヘッダ解析を行ったあと、 CriMvEasyPlayer::GetMovieInfo()で取得できる + * ムービ情報がそのままストリーミングパラメータとなりますので、調整したい値を変更して、本関数で設定しなお + * してください。 + * + * \sa CriMvEasyPlayer::GetMovieInfo(), CriMvEasyPlayer::DecodeHeader() + */ + void SetStreamingParameters(CriMvStreamingParameters *stmprm, CriError &err=CriMv::ErrorContainer); + + /*EN + * \ingroup MODULE_VIDEO_FRAME + * + * \brief Determine if a new video frame can be displayed + * + * \param err Optional error code + * + * \return TRUE if a frame is ready to be displayed + * \return FALSE if the movie is paused or not playing, or if a new frame is + * not yet decoded or ready to be displayed + * + * Each frame in a movie corresponds to an absolute time, with the first frame being time 0. + * The playback time is controlled by the master timer for this handle. + * If the time of the next frame is less than or equal to the current playback time, as determined + * by CriMvEasyPlayer::GetTime(), it is ready to be displayed, and this function will return TRUE. + * + * If an application needs to do some complex or lengthy processing before displaying a frame (such + * as locking a texture), it should call this function first. + * + * \remarks + * If the next frame has not yet been decoded, this function will return FALSE regardless of the playback time. + * + * \sa CriMvEasyPlayer::GetTime() + */ + /*JP + * \ingroup MODULE_VIDEO_FRAME + * \brief 次フレームの表示時刻判定 + * \param err エラー情報(省略可) + * \return 次のビデオフレームがすでに表示時刻になっている場合はTRUE(1)を返します。
+ * 次のビデオフレームがまだデコードできない場合はFALSE(0)を返します。 + * + * 次のビデオフレームがすでに表示時刻になっているかどうかを問い合わせます。
+ * もしもデコードが遅れていて次のビデオフレームがまだデコードできていない場合は、再生時刻に関係 + * なくFALSEを返します。
+ * つまりこの関数は「次のフレームが GetFrameOnTime関数で取得できるかどうか」を調べます。
+ * ビデオフレームが実際に取得するよりも先にやらなければいけない処理(例えばテクスチャロックなど) + * がある場合は、この関数でフレーム取得の成否を判定してから処理してください。 + * + * \sa CriMvEasyPlayer::GetTime() + */ + CriBool IsNextFrameOnTime(CriError &err=CriMv::ErrorContainer); + +#if !defined(XPT_TGT_EE) + /*EN + * \ingroup MODULE_VIDEO_FRAME + * + * \brief Loads video frame data into a buffer, in 32 bit ARGB format + * \param imagebuf Pointer to output buffer + * \param pitch Pitch of output buffer, in bytes + * \param bufsize Size of output buffer, in bytes + * \param frameinfo Video frame information structure + * \param err Optional error code + * \return TRUE if a frame was retrieved + * \return FALSE otherwise + * + * Copies the next decoded frame into the 32 bit ARGB image buffer pointed to by \a imagebuf. + * If the display time is less than the frame time, or if the frame has not yet been decoded, the + * \a frameinfo parameter will be cleared and this function will return FALSE. + * + * The \a pitch parameter is the width, in bytes, of each row of the frame image, including any padding. + * + * To determine if the next frame is ready to be displayed, call CriMvEasyPlayer::IsNextFrameOnTime(). + * + * CRI Movie decodes video frames into YUV420 format internally, and stores them in frame pools (see + * CriMvEasyPlayer::SetNumberOfFramePools()) for later display. When this function is called, + * the frame must first converted to ARGB format. This can be a very CPU-intensive operation, + * especially on the PS3 and Xbox360. For 1280 x 720 video resolution, this can use almost an + * entire vsync interval. On these platforms, we recommend implementing a pixel shader and calling + * CriMvEasyPlayer::GetFrameOnTimeAsYUVBuffers() instead. + * + * \remarks
+ * If an application uses this function, an application need to call CriMv::InitializeFrame32bitARGB() + * after CriMv::Initialize(). If an application calls this function without CriMv::InitializeFrame32bitARGB() + * calling, this function failed and an error callback occurs. + * + * \remarks + * This function is not available on the PS2. + * + * \sa CriMvEasyPlayer::IsNextFrameOnTime(), CriMvEasyPlayer::GetFrameOnTimeAsYUVBuffers(), + * CriMvEasyPlayer::SetNumberOfFramePools() + */ + /*JP + * \ingroup MODULE_VIDEO_FRAME + * \brief 32bit ARGBフォーマットでのデコード結果の取得 + * \param imagebuf 出力バッファポインタ + * \param pitch 出力バッファのピッチ [byte] + * \param bufsize 出力バッファのサイズ [byte] + * \param frameinfo 取得したビデオフレームの情報構造体 + * \param err エラー情報(省略可) + * \return フレームが取得できた場合はTRUE(1)、できなかった場合はFALSE(0)を返します。 + * + * 32bit ARGBフォーマットで、表示時刻になっているビデオフレームを取得します。
+ * この関数を呼び出す場合は、ARGBバッファの実体を確保したうえで呼び出す必要があります。
+ * ビデオフレームは引数imagebufで指定したARGBバッファに書き出されます。
+ * もしも次のビデオフレームの表示時刻になっていなかったり、デコードが終わっていなかった場合は + * フレーム取得できず、frameinfoの中身はクリアされます。
+ * 事前にビデオフレームが取得できるかどうかを知りたい場合は CriMvEasyPlayer::IsNextFrameOnTime() + * を使用してください。 + * + * 32bit ARGB の実際のピクセルデータの並びについては、そのプラットフォームで最も標準的な + * フォーマットになります。 + * + * 注意:
+ * 本関数を使用する場合はフレーム変換の初期化 CriMv::InitializeFrame32bitARGB()の呼び出しが + * 事前に必要です。フレーム変換の初期化を行わずに本関数を呼び出した場合はフレーム取得に失敗し、 + * エラーコールバックが発生します。 + * + * 注意:
+ * PS3, Xbox360 でも本関数は使用できますが、とてもCPU負荷の高い関数となります。
+ * 解像度が 1280x720 のムービを本関数をフレーム取得すると1vsync近い時間がかかります。
+ * PS3, Xbox360 ではCriMvEasyPlayer::GetFrameOnTimeAsYUVBuffers() 関数と ピクセルシェーダー + * の組み合わせによるフレーム変換をおすすめします。
+ * + * 備考:
+ * PS2版CRI Movie は本関数に対応していません。 + * + * \sa CriMvEasyPlayer::IsNextFrameOnTime() + */ + CriBool GetFrameOnTimeAs32bitARGB(CriUint8 *imagebuf, CriUint32 pitch, CriUint32 bufsize, CriMvFrameInfo &frameinfo, + CriError &err=CriMv::ErrorContainer); +#endif + +#if !defined(XPT_TGT_EE) + /*EN + * \ingroup MODULE_VIDEO_FRAME + * + * \brief Loads video frame data into a set of Y,U,V separate buffers + * \param yuvbuffers Pointer to Y,U,V buffer data structure + * \param frameinfo Video frame information structure + * \param err Optional error code + * \return TRUE if a frame was retrieved + * \return FALSE otherwise + * + * Copies the next decoded frame into the Y,U,V image buffers pointed to by \a yuvbuffers, for use + * with a pixel shader. CRI Movie decodes video frames into YUV420 format internally, so this is + * a very efficient function. + * + * If the display time is less than the frame time, or if the frame has not yet been decoded, the + * \a frameinfo parameter will be cleared and this function will return FALSE. + * + * To determine if the next frame is ready to be displayed, call CriMvEasyPlayer::IsNextFrameOnTime(). + * + * \remarks + * If the movie does not have an alpha channel, the alpha buffer fields of the \a CriMvYuvBuffers + * structure are not used. + * + * \remarks + * This function is not available on the PS2. + * + * \sa CriMvEasyPlayer::IsNextFrameOnTime() + */ + /*JP + * \ingroup MODULE_VIDEO_FRAME + * \brief YUV個別バッファへのデコード結果の取得 + * \param yuvbuffers YUV個別バッファのパラメータ構造体 + * \param frameinfo 取得したビデオフレームの情報構造体 + * \param err エラー情報(省略可) + * \return フレームが取得できた場合はTRUE(1)、できなかった場合はFALSE(0)を返します。 + * + * YUV個別バッファ形式で表示時刻になっているビデオフレームを取得します。
+ * YUV個別バッファ形式はピクセルシェーダーでフレームを描画するための出力フォーマットです。
+ * この関数を呼び出す場合は、YUV個別バッファの実体を確保したうえで呼び出す必要があります。
+ * ビデオフレームは引数yuvbuffersで指定したYUV個別バッファに書き出されます。
+ * もしも次のビデオフレームの表示時刻になっていなかったり、デコードが終わっていなかった場合は + * フレーム取得できず、frameinfoの中身はクリアされます。
+ * 事前にビデオフレームが取得できるかどうかを知りたい場合は CriMvEasyPlayer::IsNextFrameOnTime() + * を使用してください。
+ *
+ * アルファムービ再生を行わない場合は、引数 yuvbuffers のAlphaテクスチャ関連のパラメータは使用しません。
+ * + * 備考:
+ * PS2版CRI Movie は本関数に対応していません。 + * + * \sa CriMvEasyPlayer::IsNextFrameOnTime() + */ + CriBool GetFrameOnTimeAsYUVBuffers(CriMvYuvBuffers *yuvbuffers, CriMvFrameInfo &frameinfo, + CriError &err=CriMv::ErrorContainer); +#endif + +#if defined(XPT_TGT_PC) || defined(XPT_TGT_SH7269) || defined(XPT_TGT_TRGP6K) + /*EN + * \ingroup MODULE_VIDEO_FRAME + * + * \brief Loads video frame data into a buffer, in YUV422 format + * \param imagebuf Pointer to output buffer + * \param pitch Pitch of output buffer, in bytes + * \param bufsize Size of output buffer, in bytes + * \param frameinfo Video frame information structure + * \param err Optional error code + * \return TRUE if a frame was retrieved + * \return FALSE otherwise + * + * Copies the next decoded frame into the YUV422 texture buffer pointed to by \a imagebuf. + * CRI Movie decodes video frames into YUV420 format internally, so there is some internal conversion + * required when using this function. + * + * If the display time is less than the frame time, or if the frame has not yet been decoded, the + * \a frameinfo parameter will be cleared and this function will return FALSE. + * + * The \a pitch parameter is the width, in bytes, of each row of the frame image, including any padding. + * + * To determine if the next frame is ready to be displayed, call CriMvEasyPlayer::IsNextFrameOnTime(). + * + * \remarks + * This function is currently only available in the PC version of CRI Movie. + * + * \sa CriMvEasyPlayer::IsNextFrameOnTime() + */ + /*JP + * \ingroup MODULE_VIDEO_FRAME + * \brief YUV422フォーマットでのデコード結果の取得 + * \param imagebuf 出力バッファのポインタ + * \param pitch 出力バッファのピッチ [byte] + * \param bufsize 出力バッファサイズ [byte] + * \param frameinfo 取得したビデオフレームの情報構造体 + * \param err エラー情報(省略可) + * \return フレームが取得できた場合はTRUE(1)、できなかった場合はFALSE(0)を返します。 + * + * YUV422テクスチャフォーマットで、表示時刻になっているビデオフレームを取得します。
+ * この関数を呼び出す場合は、YUVバッファの実体を確保したうえで呼び出す必要があります。
+ * ビデオフレームは引数imagebufで指定したYUVバッファに書き出されます。
+ * もしも次のビデオフレームの表示時刻になっていなかったり、デコードが終わっていなかった場合は + * フレーム取得できず、frameinfoの中身はクリアされます。
+ * 事前にビデオフレームが取得できるかどうかを知りたい場合は CriMvEasyPlayer::IsNextFrameOnTime() + * を使用してください。 + * + * 【備考】
+ * 現在は、PC版CRI Movie のみ本関数に対応しています。 + * + * \sa CriMvEasyPlayer::IsNextFrameOnTime() + */ + CriBool GetFrameOnTimeAsYUV422(CriUint8 *imagebuf, CriUint32 pitch, CriUint32 bufsize, CriMvFrameInfo &frameinfo, + CriError &err=CriMv::ErrorContainer); +#endif + +#if defined(XPT_TGT_IPHONE) || defined(XPT_TGT_WINMO) || defined(XPT_TGT_ANDROID) || defined(XPT_TGT_CQSH2A) || defined(XPT_TGT_ACRODEA) || defined(XPT_TGT_NACL) || defined(XPT_TGT_SH7269) || defined(XPT_TGT_PC)|| defined(XPT_TGT_TRGP6K) + /*EN + * \ingroup MODULE_VIDEO_FRAME + * \brief Get video frame data to 16bit RGB565 format buffer + * + * This function is added for a prototype library for iPhone + * Please add comments when releasing the SDK. + * + */ + /*JP + * \ingroup MODULE_VIDEO_FRAME + * \brief 16bit RGB565フォーマットでのデコード結果の取得 + * + * この関数はiPhone版CRI Movieのプロトタイプ用の関数宣言です。 + * SDKとしてリリースする際は、コメントを追加して下さい。 + * + */ + CriBool GetFrameOnTimeAsRGB565(CriUint8 *imagebuf, CriUint32 pitch, CriUint32 bufsize, CriMvFrameInfo &frameinfo, + CriError &err=CriMv::ErrorContainer); +#endif + +#if defined(XPT_TGT_EE) + /*EN + * \ingroup MODULE_VIDEO_FRAME + * + * \brief Gets a reference to EasyPlayer's internal video frame buffer, in 32 bit ARGB format + * \param frameinfo Video frame information structure + * \param err Optional error code + * \return TRUE if a frame was retrieved + * \return FALSE otherwise + * + * Locks the internal buffer for the current video frame in memory, and retrieves a pointer to it. This is + * different behavior than the GetFrameXXX()functions, which copy the frame data into a caller-supplied location. + * + * On successful return from this function, the fields of \a frameinfo will be populated with information + * about the frame. In particular, the \a imageptr field will be set to the image buffer, in 32 bit ARGB format. + * After calling this function, an application must copy the video frame into its own buffer or transfer it to + * GS local memory via DMA. + * + * To determine if the next frame is ready to be displayed, call CriMvEasyPlayer::IsNextFrameOnTime(). + * + * \remarks + * After the application has copied the frame data, it must call CriMvEasyPlayer::UnlockFrame(). + * + * \remarks + * This function is only available on the PS2. + * + * \sa CriMvEasyPlayer::IsNextFrameOnTime(), CriMvEasyPlayer::UnlockFrame() + */ + /*JP + * \ingroup MODULE_VIDEO_FRAME + * \brief デコード結果領域(ARGB32bit)のロック。PS2専用。 + * \param frameinfo ロックしたビデオフレームの情報構造体 + * \param err エラー情報(省略可) + * + * 本関数はPS2専用のフレーム取得関数で、他機種の GetFrame 関数に相当します。
+ * PS2では GetFrame 関数の代わりに本関数と UnlockFrame 関数を使用してフレーム取得を行います。
+ * GetFrame 関数は出力バッファを指定してそこへデコード結果を取得するのに対し、LockFrame 関数はバッファを指定せず + * CriMvEasyPlayerハンドル内部にあるデコード結果バッファのポインタを取得するところが違います。
+ * + * 本関数はデコード結果のメモリ領域を参照開始するためにロックします。
+ * この関数でフレームをロックできるのは、そのフレームが表示可能時間になっている場合のみです。
+ * アプリケーションはフレームをロックしたあと、デコード結果をDMAでテクスチャ領域へ転送するか、 + * 別バッファへコピーするなどの処理を行います。
+ * デコード結果の参照が終わった後には、必ず CriMvEasyPlayer::UnlockFrame() 関数を呼び出して参照終了を通知してください。
+ * + * 備考:
+ * 本関数はPS2版CRI Movie のみ対応しています。 + * + * \sa CriMvEasyPlayer::IsNextFrameOnTime(), CriMvEasyPlayer::UnlockFrame() + */ + CriBool LockFrameOnTimeAs32bitARGB_PS2(CriMvFrameInfo &frameinfo, CriError &err=CriMv::ErrorContainer); +#endif + + /*EN + * \ingroup MODULE_VIDEO_FRAME + * + * \brief Unlocks the video frame + * \param frameinfo Pointer to locked video frame information + * \param err Optional error code + * + * Unlocks the video frame that was locked in memory by a call to one of the LockFrameXXX() functions. + * + * The \a frameinfo parameter must be the same one that was passed to LockFrameXXX(). + * + * If the frame has been locked, EasyPlayer will not be able to retrieve the next frame until the frame is + * unlocked. An attempt to lock the same frame more than once will fail. + * + * The LockFrameXXX() functions are CriMvEasyPlayer::LockFrameOnTimeAs32bitARGB_PS2() and + * CriMvEasyPlayer::LockFrameOnTimeAsYUVBuffers(). Depending on the platform, only one or the other of + * these functions will be available. + * + * \sa CriMvEasyPlayer::LockFrameOnTimeAs32bitARGB_PS2(), CriMvEasyPlayer::LockFrameOnTimeAsYUVBuffers() + */ + /*JP + * \ingroup MODULE_VIDEO_FRAME + * \brief ロックフレームで取得したデコード結果をアンロックする + * \param frameinfo ロックしたビデオフレームの情報構造体 + * \param err エラー情報(省略可) + * + * 本関数はロックフレーム関数を使ってロックしていたフレームをアンロックし、メモリ参照の終了を通知します。
+ * ロックフレーム関数には CriMvEasyPlayer::LockFrameOnTimeAs32bitARGB_PS2() と CriMvEasyPlayer::LockFrameOnTimeAsYUVBuffers() + * がありますが、どちらの関数を使ってロックした場合も、本関数を使ってアンロックします。
+ * 本関数の引数には、どのフレームをアンロックするかを指示するために、ロックフレーム関数で取得したフレーム情報構造体を指定します。
+ * + * 本関数でアンロックしたフレームは、以後、次にビデオフレームのデコード出力バッファとして使用されます。
+ * 1度アンロックしたフレームをもう一度ロックすることは出来ません。
+ * + * \sa CriMvEasyPlayer::LockFrameOnTimeAs32bitARGB_PS2(), CriMvEasyPlayer::LockFrameOnTimeAsYUVBuffers() + */ + CriBool UnlockFrame(CriMvFrameInfo *frameinfo, CriError &err=CriMv::ErrorContainer); + +#if !defined(XPT_TGT_EE) + /*EN + * + * \brief Gets a reference to EasyPlayer's internal video frame buffer + * \param yuvbuffers Y,U,V buffer data structure + * \param frameinfo Video frame information structure + * \param err Optional error code + * \return TRUE if a frame was retrieved + * \return FALSE otherwise + * + * Locks the internal buffer for the current video frame in memory, and retrieves a pointer to it. This is + * different behavior than the GetFrameXXX() functions, which copy the frame data into a caller-supplied location. + * + * On successful return from this function, the fields of \a yuvbuffers will be set to the Y,U,V fields of the + * video frame, and the fields of \a frameinfo will be populated with information about the frame. + * + * After calling this function, an application must copy the video frame into its own buffer or transfer it to + * texture memory. + * + * To determine if the next frame is ready to be displayed, call CriMvEasyPlayer::IsNextFrameOnTime(). + * + * \remarks + * After the application has copied the frame data, it must call CriMvEasyPlayer::UnlockFrame(). + * + * \remarks + * This function is not available on the PS2. + * + * \sa CriMvEasyPlayer::IsNextFrameOnTime(), CriMvEasyPlayer::UnlockFrame() + */ + /*JP + * \ingroup MODULE_VIDEO_FRAME + * \brief デコード結果領域のロック + * \param yuvbuffers YUV個別バッファのパラメータ構造体 + * \param frameinfo ロックしたビデオフレームの情報構造体 + * \param err エラー情報(省略可) + * + * GetFrame とは別の仕様のフレーム取得関数です。
+ * 本関数は UnlockFrame 関数とセットで使用します。
+ * GetFrame 関数は出力バッファを指定してそこへデコード結果を取得するのに対し、LockFrame 関数はバッファを指定せず + * CriMvEasyPlayerハンドル内部にあるデコード結果バッファのポインタを取得するところが違います。
+ * + * 本関数はデコード結果のメモリ領域を参照開始するためにロックし、 + * デコード結果のYUV3種類のバッファについての情報を引数 yuvbuffers に格納します。
+ * この関数でフレームをロックできるのは、そのフレームが表示可能時間になっている場合のみです。
+ * アプリケーションはフレームをロックしたあと、デコード結果をテクスチャ領域へコピーするか、 + * 別バッファへコピーするなどの処理を行います。
+ * デコード結果の参照が終わった後には、必ず CriMvEasyPlayer::UnlockFrame() 関数を呼び出して参照終了を通知してください。
+ * + * 備考:
+ * PS2版CRI Movie は本関数に対応していません。 + * + * \sa CriMvEasyPlayer::UnlockFrame() + */ + CriBool LockFrameOnTimeAsYUVBuffers(CriMvYuvBuffers &yuvbuffers, CriMvFrameInfo &frameinfo, + CriError &err=CriMv::ErrorContainer); +#endif + + /*EN + * \ingroup MODULE_VIDEO_FRAME + * + * \brief Discards the next video frame + * \param frameinfo Discarded frame information structure + * \param err Optional error code + * \return TRUE if a frame was available to discard + * \return FALSE otherwise + * + * Discards the next video frame, if it is available, and populates \a frameinfo with information about + * the frame. Note that the \a imageptr field of that structure will not be available and should not + * be referenced. + * + * To determine if the next frame is ready to be displayed, call CriMvEasyPlayer::IsNextFrameOnTime(). + * + * \sa CriMvEasyPlayer::IsNextFrameOnTime() + */ + /*JP + * \ingroup MODULE_VIDEO_FRAME + * \brief 次フレームを取得せずに捨てる + * \param frameinfo 破棄したビデオフレームの情報構造体 + * \param err エラー情報(省略可) + * + * デコード済みのビデオフレームを捨てたい場合に使用する関数です。
+ * フレーム取得関数と比べると、出力用バッファを準備する必要が無い部分が特徴です。
+ * CriMvEasyPlayer::IsNextFrameOnTime()で次フレームが取得できることを確認した後、本関数を呼び出してください。
+ * 引数frameinfoには参考のために破棄したビデオフレームの情報が格納されますが、デコード結果自体にはアクセスできません。 + * + * \sa CriMvEasyPlayer::IsNextFrameOnTime() + */ + CriBool DiscardNextFrame(CriMvFrameInfo &frameinfo, CriError &err=CriMv::ErrorContainer); + + /*EN + * \ingroup MODULE_OPTION + * + * \brief Sets the current channel for displaying subtitles + * + * \param channel Subtitle channel number + * \param err Optional error code + * + * A movie can contain up to 16 distinct sets of subtitles, each on its own display channel. This can + * be used, for instance, to provide multilanguage support. + * + * Subtitle channels are numbered sequentially, starting from 0, but do not need to be contiguous. + * For example, a movie can have 3 sets of subtitles, on channels 1, 5, and 7. The number of channels + * can be determined once CriMvEasyPlayer::GetMovieInfo() has completed successfully by looking at the + * \a num_subtitle field of the \a CriMvStreamingParameters structure passed to that function. + * + * By default, subtitle playback is off. To turn off subtitles once they have been turned on, pass + * CRIMV_SUBTITLE_CHANNEL_OFF as the value of \a channel. + * + * If the selected subtitle channel does not exist, subtitles will not be displayed. + * + * \remarks + * If an application turns on subtitle display with this function, it must periodically call + * CriMvEasyPlayer::GetSubtitleOnTime(), or else movie playback will stall. + * + * \sa CriMvEasyPlayer::GetMovieInfo(), CriMvEasyPlayer::DecodeHeader(), CriMvEasyPlayer::GetSubtitleOnTime() + */ + /*JP + * \ingroup MODULE_OPTION + * \brief 取得する字幕チャネルの設定 + * \param channel 字幕チャネル + * \param err エラー情報(省略可) + * + * 取得する字幕チャネルを設定します。デフォルトは字幕取得無しです。 + * + * CriMvEasyPlayer::DecodeHeader()と CriMvEasyPlayer::GetMovieInfo()を使うことで、再生するムービが + * いくつの字幕を含んでいるかを再生開始前に知ることができます。 + * + * データが存在しないチャネル番号を指定した場合は、字幕は取得できません。
+ * デフォルト設定(字幕取得無し)にしたい場合は、チャネルとしてCRIMV_SUBTITLE_CHANNEL_OFFを指定してください。 + * + * この関数で字幕チャネルを指定した場合は、メインループから定期的に CriMvEasyPlayer::GetSubtitleOnTime() を + * 実行してください。字幕取得を定期的に行わない場合は、ムービ再生が途中で止まります。 + * + * \sa CriMvEasyPlayer::GetMovieInfo(), CriMvEasyPlayer::DecodeHeader(), CriMvEasyPlayer::GetSubtitleOnTime + */ + void SetSubtitleChannel(CriSint32 channel, CriError &err=CriMv::ErrorContainer); + + /*EN + * \ingroup MODULE_VIDEO_FRAME + * + * \brief Retrieves subtitle data for the current frame, if available + * + * \param bufptr Buffer to receive subtitle data + * \param bufsize Size of buffer, in bytes + * \param err Optional error code + * + * \return The number of bytes copied into \a bufptr + * + * If the movie contains subtitle data, and there is a subtitle for the current frame, up to \a bufsize + * bytes of the subtitle data for the active subtitle channel will be copied into \a bufptr. Otherwise, + * the entire buffer will be filled with zeroes. + * + * \remarks + * If an application turns on subtitle display with CriMvEasyPlayer::SetSubtitleChannel(), it must + * periodically call this function, or else movie playback will stall. + * + * \remarks + * An application should not make assumptions as to whether the returned data is NUL-terminated. + * + * \sa CriMvEasyPlayer::SetSubtitleChannel() + */ + /*JP + * \ingroup MODULE_VIDEO_FRAME + * \brief 字幕データの取得 + * \param bufptr 出力バッファポインタ + * \param bufsize 出力バッファサイズ [byte] + * \param err エラー情報(省略可) + * \return 取得した字幕データのサイズ[byte]を返します。 + * + * 表示時刻になっている字幕データを取得します。 + * この関数を呼び出す場合は、字幕用バッファの実体を確保したうえで呼び出してください。
+ * 字幕データは引数 bufptr で指定したバッファに書き出されます。
+ * もし字幕データが bufsize よりも大きい場合は、bufsize に収まる量だけ書き出し、残りは破棄されます。 + * + * もしも表示時刻の字幕が無い場合は、バッファの中身はクリアされます。 + * + * CriMvEasyPlayer::SetSubtitleChannel()で存在する字幕チャネルを指定している場合は、 + * メインループから定期的に本関数を実行してください。
+ * 実行しない場合は、ムービ再生が途中で止まります。 + * + * \sa CriMvEasyPlayer::SetSubtitleChannel() + */ + CriUint32 GetSubtitleOnTime(CriUint8 *bufptr, CriUint32 bufsize, CriError &err=CriMv::ErrorContainer); + + /*EN + * \ingroup MODULE_OPTION + * + * \brief Sets a secondary sound interface + * + * \param sound Secondary sound interface to attach to this handle + * \param err Optional error code + * + * A subaudio interface allows an application to play two audio tracks at the same time. This is + * typically used to play a dialog track or sound effects along with background music. After calling + * this function, an application needs to call CriMvEasyPlayer::SetSubAudioTrack() to choose the secondary + * audio track to play. + * + * Note that you must create a separate sound interface to pass to this function. The interface used + * in the CriMvEasyPlayer::Create() call can not be used. + * + * If a subaudio interface is used, the application must call CriMvEasyPlayer::DetachSubAudioInterface() + * when the EasyPlayer handle reaches the MVEASY_STATUS_STOP or MVEASY_STATUS_PLAYEND state before calling + * CriMvEasyPlayer::Destroy(). + * + * Calling CriMvEasyPlayer::ResetAllParameters() will not affect the value set by this function. + * + * \remarks + * If this function is called, it must be called before starting playback (with either CriMvEasyPlayer::Prepare() + * or CriMvEasyPlayer::Start()). + * + * \remarks + * An EasyPlayer handle can not use a subaudio interface and center channel replacement (see + * CriMvEasyPlayer::ReplaceCenterVoice()) at the same time. + * + * \sa CriMvEasyPlayer::DetachSubAudioInterface(), CriMvEasyPlayer::SetSubAudioTrack(), + * CriMvEasyPlayer::ReplaceCenterVoice() + */ + /*JP + * \ingroup MODULE_OPTION + * \brief サブオーディオ用サウンドインタフェースの設定 + * \param sound サブオーディオ用サウンドインタフェース + * \param err エラー情報(省略可) + * + * サブオーディオ(メインオーディオと同時に別のオーディオを再生する機能)のための + * サウンドインタフェースを設定します。
+ * 設定するサウンドインタフェースは、 CriMvEasyPlayer::Create() 時に指定したサウンドインタフェース + * とは「別の」インスタンスでなければいけません。
+ * + * 本関数は、EasyPlayerハンドル作成後、 CriMvEasyPlayer::Start() または CriMvEasyPlayer::Prepare() の + * 呼び出しより前に実行しなければいけません。
+ * + * サブオーディオを再生するには、本関数でサウンドインタフェースを設定したあと、 + * CriMvEasyPlayer::SetSubAudioTrack() でサブオーディオのトラックを指定してください。
+ * + * サブオーディオ用サウンドインタフェースを設定したハンドル破棄を破棄する前に、 + * MVEASY_STATUS_STOP または MVEASY_STATUS_PLAYEND の状態で CriMvEasyPlayer::DetachSubAudioInterface() を呼んでください。 + * なお、サブオーディオ用サウンドインタフェースは CriMvEasyPlayer::ResetAllParameters() を呼び出してもリセットされません。 + * + * 注意:
+ * サブオーディオ機能は、 CriMvEasyPlayer::ReplaceCenterVoice() によるセンターチャネル置き換え機能とは + * 同時に使用できません。
+ * + * \sa CriMvEasyPlayer::DetachSubAudioInterface(), CriMvEasyPlayer::SetSubAudioTrack(), + * CriMvEasyPlayer::ReplaceCenterVoice() + */ + void AttachSubAudioInterface(CriMvSoundInterface *sound, CriError &err=CriMv::ErrorContainer); + + /*EN + * \ingroup MODULE_OPTION + * + * \brief Removes a secondary audio interface + * + * \param err Optional error code + * + * Removes the secondary sound interface that was set by a call to CriMvEasyPlayer::AttachSubAudioInterface(). + * + * This function should be called when the EasyPlayer handle's state is either MVEASY_STATUS_STOP or + * MVEASY_STATUS_PLAYEND. + * + * \sa CriMvEasyPlayer::AttachSubAudioInterface() + */ + /*JP + * \ingroup MODULE_OPTION + * \brief サブオーディオ用サウンドインタフェースの解除 + * \param err エラー情報(省略可) + * + * 現在設定されているサブオーディオ用サウンドインタフェースを解除します。
+ * + * 本関数は、EasyPlayerハンドルの状態が CriMvEasyPlayer::MVEASY_STATUS_STOP または + * CriMvEasyPlayer::MVEASY_STATUS_PLAYEND の時に呼び出してください。
+ * + * \sa CriMvEasyPlayer::AttachSubAudioInterface() + */ + void DetachSubAudioInterface(CriError &err=CriMv::ErrorContainer); + + /*EN + * \ingroup MODULE_OPTION + * + * \brief Sets the secondary audio track + * + * \param track Track number + * \param err Optional error code + * + * A secondary, or subaudio, track is typically used to play a dialog track or sound effects along + * with a movie. An application can support several different languages by setting the desired language + * track with this function. By default, the subaudio track is disabled, even if the interface has been set. + * + * Subaudio is enabled with CriMvEasyPlayer::AttachSubAudioInterface(). If the interface has not been set, + * this function will have no effect. + * + * The main audio track for the movie is set with CriMvEasyPlayer::SetAudioTrack(). If the same track + * number is used for the main and subaudio, the subaudio will not play. + * + * To turn off the subaudio track, pass CRIMV_CENTER_VOICE_OFF as the track number. + * + * \remarks + * If this function is called, it must be called before starting playback (with either CriMvEasyPlayer::Prepare() + * or CriMvEasyPlayer::Start()). + * + * \remarks + * An EasyPlayer handle can not use a subaudio interface and center channel replacement (see + * CriMvEasyPlayer::ReplaceCenterVoice()) at the same time. + * + * \sa CriMvEasyPlayer::AttachSubAudioInterface(), CriMvEasyPlayer::ReplaceCenterVoice() + */ + /*JP + * \ingroup MODULE_OPTION + * \brief サブオーディオトラックの設定 + * \param track サブオーディオ再生するトラック番号 + * \param err エラー情報(省略可) + * + * サブオーディオトラックを設定します。デフォルト値は CRIMV_CENTER_VOICE_OFF です。
+ * + * サブオーディオを再生するには、 CriMvEasyPlayer::AttachSubAudioInterface() でサウンドインタフェースを設定したあと、 + * 本関数でサブオーディオのトラックを指定してください。
+ * 本関数の呼び出しは、 CriMvEasyPlayer::Start() または CriMvEasyPlayer::Prepare() の呼び出しより前でなければいけません。
+ * + * メインオーディオのトラックは CriMvEasyPlayer::SetAudioTrack() で指定します。 + * サブオーディオトラックとしてメインオーディオと同じトラックを指定した場合は、サブオーディオからは何も再生されません。
+ * + * サブオーディオトラックには、センターチャネル置き換え機能とは異なりチャネル数の制限はありません。 + * モノラル、ステレオ、5.1ch のいずれのトラックもサブオーディオとして使用することができます。
+ * + * 注意:
+ * サブオーディオ機能は、 CriMvEasyPlayer::ReplaceCenterVoice() によるセンターチャネル置き換え機能とは + * 同時に使用できません。
+ * + * \sa CriMvEasyPlayer::AttachSubAudioInterface() + */ + // default value is -1. + void SetSubAudioTrack(CriSint32 track, CriError &err=CriMv::ErrorContainer); + + /*EN + * \ingroup MODULE_OPTION + * + * \brief Retrieves the secondary audio track + * + * \param err Optional error code + * \return track number Current subaudio track number + * + * When you successfully set the subaudio track, this function return the track number + * that you specified by CriMvEasyPlayer::SetSubAudioTrack(). Otherwise, it retuns CRIMV_CENTER_VOICE_OFF. + * + * \sa CriMvEasyPlayer::SetSubAudioTrack() + */ + /*JP + * \ingroup MODULE_OPTION + * \brief サブオーディオトラックの取得 + * \param err エラー情報(省略可) + * \return トラック番号 現在設定されているトラック番号 + * + * サブオーディオ再生が有効になっていれば、ユーザがCriMvEasyPlayer::SetSubAudioTrack()で設定した + * サブオーディオトラック番号を返します。 + * + * サブオーディオ再生が有効でない場合や、サブオーディオトラックを指定していなかった場合は、 + * CRIMV_CENTER_VOICE_OFFを返します。 + * + * \sa CriMvEasyPlayer::SetSubAudioTrack() + */ + CriSint32 GetSubAudioTrack(CriError &err=CriMv::ErrorContainer); + + /*EN + * \ingroup MODULE_OPTION + * + * \brief Replaces the center channel of a 5.1ch audio track + * + * \param track Track number to use + * \param err Optional error code + * + * If the current audio track for a movie (set with CriMvEasyPlayer::SetAudioTrack()) is in 5.1ch + * surround sound, the center channel can be replaced with a different, mono, track. This does not + * affect any of the other channels in the 5.1ch track. + * + * If the current audio track is not 5.1ch, or the replacement track is not monaural, this call will + * have no effect. + * + * Passing CRIMV_CENTER_VOICE_OFF as the value of \a track will undo the replacement and revert to + * playing the original center channel of th 5.1ch track. + * + * \remarks + * An EasyPlayer handle can not use center channel replacement and a subaudio interface (see + * CriMvEasyPlayer::AttachSubAudioInterface() and CriMvEasyPlayer::SetSubAudioTrack()) at the same time. + * + * \sa CriMvEasyPlayer::SetAudioTrack(), CriMvEasyPlayer::AttachSubAudioInterface(), + * CriMvEasyPlayer::SetSubAudioTrack() + */ + /*JP + * \ingroup MODULE_OPTION + * \brief センターボイスの設定 + * \param track ボイストラック番号 + * \param err エラー情報(省略可) + * + * 5.1ch オーディオ再生時に、センターチャネルだけを別のモノラルトラックと置き換えることができます。
+ * 本関数は、置き換え用のモノラルデータが入ったオーディオトラックを設定します。
+ * 5.1ch BGM に対して、ボイスだけを複数種類から差し替えたい場合に使用してください。 + * + * デフォルトはセンターボイス指定無しです。 + * + * この関数を使用した場合、メインのオーディオトラックとして再生している5.1chデータのセンターチャネル + * は破棄され、代わりにセンターボイスとして指定したデータが入ります。 + * + * (a) センターボイスとして使用できるのはモノラルのオーディオだけです。
+ * (b) センター置き換えが有効なのはメインのオーディオが5.1chの場合だけです。 + * + * この二つの条件を満たしていない場合は、本関数で設定した値は無視されます。 + * + * デフォルト値に戻したい場合は、チャネルとしてCRIMV_CENTER_VOICE_OFFを指定してください。 + * + * \sa CriMvEasyPlayer::SetAudioTrack(), CriMvEasyPlayer::AttachSubAudioInterface(), + * CriMvEasyPlayer::SetSubAudioTrack() + */ + void ReplaceCenterVoice(CriSint32 track, CriError &err=CriMv::ErrorContainer); + + /*EN + * \ingroup MODULE_OPTION + * + * \brief Sets a callback function that will set the movie file + * + * \param func Callback function + * \param usrobj Pointer to user-provided data + * \param err Optional error code + * + * Normally, the movie file is provided directly, via CriMvEasyPlayer::SetFile() or + * CriMvEasyPlayer::SetData(), before playback is started. Setting a file request callback + * allows an application to do \a concatenated \a playback, playing multiple movies, one + * after the other. + * + * If the callback function is set, it will be called when + * + * - The last data chunk of the current movie has been read by EasyPlayer. + * - Any of the playback functions (CriMvEasyPlayer::Start(), CriMvEasyPlayer::Prepare(), + * or CriMvEasyPlayer::DecodeHeader()) are called and the movie file has not been set. + * + * The callback should call CriMvEasyPlayer::SetFile() or CriMvEasyPlayer::SetData() if the + * application wants to continue playback. Otherwise, playback will end once the callback returns. + * + * The \a usrobj parameter specifies a pointer to arbitrary data, that will be passed as the + * second parameter to the callback. + * + * The prototype of the callback function is + * + * void callback(CriMvEasyPlayer *mveasy, void *usrobj) + * + * where + * + * mveasy is the EasyPlayer object + * usrobj is the pointer to user data that was passed to SetFileRequestCallback(). + * + * \remarks + * In order to do concatenated playback, all movies must have the same + * + * \remarks + * - video resolution + * - framerate + * - video codec + * - audio track structure + * - subtitle structure + * + * \remarks + * The same audio track structure means that all movies must have the same number of tracks, and the + * same track number must be of the same audio type for each movie. For instance, if the first movie has + * 2 audio tracks, with track 1 being stereo and track 2 being mono, then \a all other movies would have + * to have 2 tracks, track 1 stereo and track 2 mono. + * + * \remarks + * Subtitles have to match in the number of channels. For instance, if the first movie had 3 subtitle + * channels, then all other movies would need 3 channels. It is also important to keep the languages on + * the same tracks for each movie, since otherwise the application would get confused. CRI Movie makes + * no assumptions about languages or the interpretation of subtitles; subtitles are simply treated as + * binary data. + * + * \remarks + * Currently, cuepoints are not supported with concatenated playback. + * + * \sa CriMvEasyPlayer::SetFile(), CriMvEasyPlayer::SetData() + */ + /*JP + * \ingroup MODULE_OPTION + * \brief ファイル要求コールバック関数の登録 + * \param func ファイル要求コールバック関数 + * \param usrobj ユーザオブジェクト + * \param err エラー情報(省略可) + * + * ムービの連結再生を行うために、ムービファイルを要求するコールバック関数を登録します。 + * このコールバック関数は以下のタイミングで発生します。 + * + * ・ムービファイルを読み込み終了した時。
+ * ・ファイルの指定無しで再生を開始した時。 + * + * ファイル要求コールバック関数内で CriMvEasyPlayer::SetFile() または CriMvEasyPlayer::SetData() + * を呼び出すことで、連続して次のムービファイルを指定することができます。
+ * SetFile() も SetData() も呼び出さなかった場合は、読み込み済みのムービが終わると + * 再生終了になります。 + * + * ファイル要求コールバック発生時、コールバック関数の第二引数usrobjには、登録時に指定 + * したユーザオブジェクトが渡されます。登録ファイルリストなどの管理に利用してください。 + * + * 連結再生できるムービファイルには以下の条件があります。
+ * - ビデオ解像度が同じ + * - ビデオのフレームレートが同じ + * - ビデオのコーデックが同じ + * - オーディオおよび字幕のトラック構成が同じ + * + * \sa CriMvEasyPlayer::SetFile(), CriMvEasyPlayer::SetData() + */ + void SetFileRequestCallback(void (*func)(CriMvEasyPlayer *mveasy, void *usrobj), + void *usrobj, CriError &err=CriMv::ErrorContainer); + +#if defined(XPT_TGT_PC) + /*EN + * \ingroup MODULE_OPTION + * \brief Set processor parameters for decoding on PC + * + * \param num_threads Number of additional threads for load distribution in decoding (Maximum 3 threads) + * \param affinity_mask Pointer to an array of thread affinity masks for each thread specified with num_threads. + * \param priority Thread priority of the decoding threads for load balancing + * \param err Optional error code + * + * This function sets the processor parameters for decoding. Use it when you want to change + * processors or thread priority for decoding load distribution. + * + * If this function is called, it must be called before calling any of the playback functions + * (CriMvEasyPlayer::Start(), CriMvEasyPlayer::Prepare(), or CriMvEasyPlayer::DecodeHeader()). + * + * On initialization, CRI Movie prepares three worker threads for distributed decoding.
+ * + * \a num_threads specifies how many worker threads CRI Movie should use.
+ * \a affinity_mask is an array of affinity masks for the worker threads. This array must have + * \a num_threads many elements. The format of \a affinity_mask is same as for the value passed to the + * Win32 SetThreadAffinityMask() API function.
+ * \a priority is used as the thread priority for all of the threads specified by \a num_threads. + * + * If this function is called, three distributed decoding threads will run in parallel by default. + * Also, processor assignment of the decoding threads is handled by the operating system, and their + * priority will be normal. + * + * To reset the parameters, call this function again, passing CRIMV_DEFAULT_AFFNITY_MASK_PC and + * CRIMV_DEFAULT_THREAD_PRIORITY_PC as the affinity masks and thread priority. + * + * \sa CRIMV_DEFAULT_AFFNITY_MASK_PC, CRIMV_DEFAULT_THREAD_PRIORITY_PC + */ + /*JP + * \ingroup MODULE_OPTION + * \brief PCでデコード処理に使う追加プロセッサ設定 + * \param num_threads 負荷分散デコード用に使用する追加スレッドの数 (最大3つ) + * \param affinity_masks スレッドアフィニティマスクの配列へのポインタ。num_threadsで指定したスレッドごとのマスク値。 + * \param priority 負荷分散デコードスレッドの優先度 + * \param err エラー情報(省略可) + * + * デコード処理を分散して処理するためのプロセッサを指定できます。 + * デコード処理に行うプロセッサやスレッド優先度を変更したい場合に使用してください。 + * 本関数は再生開始(Start, Prepare, DecodeHader)前に呼び出す必要があります。 + * + * CRI Movieは初期化の際に3つの分散デコード用のワーカースレッドを用意します。 + * num_threads引数で、そのうちのいくつのスレッドを実際に使用するかを指定できます。 + * アプリケーションから明示的にプロセッサ割り当てを行いたい場合、個々のスレッドに対して + * アフィニティマスクを設定してください。 + * アフィニティマスクの値は、Win32 APIのSetThreadAffinityMaskの引数と同じ書式です。 + * スレッド優先度は、num_threadsで指定したデコードに使用するスレッドに対して適用されます。 + * + * この関数を呼ばなかった場合、3つのスレッドで並列デコードを行います。 + * デコードスレッドのプロセッサは割り当ては全てOS任せで、優先度はスレッド標準になります。 + * + * 一度本関数で設定を変更した後、状態を戻したい場合は、CRIMV_DEFAULT_AFFNITY_MASK_PC, CRIMV_DEFAULT_THREAD_PRIORITY_PCを + * 引数として指定し、再度呼び出してください。 + * + * \sa CRIMV_DEFAULT_AFFNITY_MASK_PC, CRIMV_DEFAULT_THREAD_PRIORITY_PC + */ + void SetUsableProcessors_PC(CriSint32 num_threads, const CriUint32 *affinity_mask, CriSint32 priority, + CriError &err=CriMv::ErrorContainer); + +#endif + +#if defined(XPT_TGT_XBOX360) + /*EN + * \ingroup MODULE_OPTION + * \brief Set processor parameters for decoding + * \param processors_param Processor Parameters + * \param err Optional error code + * + * \brief Set processor parameters for decoding + * \param processors_param Processor Parameters + * \param err Optional error code + * + * This function sets the processor parameters for decoding, along the priority of the + * decoding threads. + * + * If this function is called, it must be called before calling any of the playback functions + * (CriMvEasyPlayer::Start(), CriMvEasyPlayer::Prepare(), or CriMvEasyPlayer::DecodeHeader()). + * + * If you don't call this function, the EasyPlayer handle uses Processor 3 (Core 0, Thread 0) + * and Processor 5 (Core 0, Thread 0). + * + * \sa CriMvProcessorParameters_XBOX360 + */ + /*JP + * \ingroup MODULE_OPTION + * \brief Xbox360でデコードに使うプロセッサ設定 + * \param processors_param 使用プロセッサパラメータ + * \param err エラー情報(省略可) + * + * デコードに使用するプロセッサを指定します。
+ * 本関数は再生開始(Start, Prepare, DecodeHader)前に呼び出す必要があります。 + * + * また、デコードに使用する内部スレッドの優先度の設定が出来ます。 + * + * デフォルトのプロセッサ設定では、プロセッサ3(コア1スレッド1)とプロセッサ5 + * (コア2スレッド1)を使用します。 + * + * \sa CriMvProcessorParameters_XBOX360 + */ + void SetUsableProcessors_XBOX360(const CriMvProcessorParameters_XBOX360 *processors_param, + CriError &err=CriMv::ErrorContainer); +#endif + + /*EN + * \ingroup MODULE_OPTION + * + * \brief Sets the frame where playback will start + * + * \param seek_frame_id Frame (0-based) to start playing from + * \param err Optional error code + * + * To play a movie from other than the first frame, call this function before starting playback. + * To seek to a new frame when the movie is already playing, call CriMvEasyPlayer::Stop() and wait + * for the handle to change to the MVEASY_STATUS_STOP state, call this function with the desired + * frame number, then call CriMvEasyPlayer::Start() again. + * + * Valid values for seek_frame_id are from 0 to \a num_frames - 1, where \a num_frames can be found by + * + *
+	 *
+	 *   CriMvStreamingParameters streaming_params;
+	 *   CriSint32                num_frames;
+	 *
+	 *   GetMovieInfo(streaming_params);
+	 *   num_frames = streaming_params.video_prm[0].total_frames;
+	 *
+	 * 
+ * + * Refer to \ref usr_mech7 for more information. + * + * \remarks + * If the value of \a seek_frame_id is out of range, playback will start from frame 0. + * + * \sa CriMvStreamingParameters + */ + /*JP + * \ingroup MODULE_OPTION + * \brief シーク再生開始位置の設定 + * \param seek_frame_id シーク再生開始するフレーム番号(0~) + * \param err エラー情報(省略可) + * + * シーク再生を開始するフレーム番号を指定します。 + * + * 再生開始前( CriMvEasyPlayer::Prepare()または CriMvEasyPlayer::Start()呼び出し前)に本関数を実行してください。 + * また、この関数はムービの再生中に呼び出すことは出来ません。再生中にシークをする場合は、一度再生を停止してから + * 本関数を呼び出してください。 + * + * 本関数を実行しなかった場合、またはフレーム番号0を指定した場合はムービの先頭から再生を開始します。 + * 指定したフレーム番号が、ムービデータの総フレーム数より大きかったり負の値だった場合もムービの先頭から再生します。 + * + * \ref usr_mech7 もあわせて参照してください。 + * + */ + void SetSeekPosition(CriSint32 seek_frame_id, CriError &err=CriMv::ErrorContainer); + + /*EN + * + * \brief Calculates a frame ID from a frame time + * + * \param count Timer counter + * \param unit Counter increment per second + * \param err Optional error code + * + * \return Frame ID corresponding to given time + * + * Each frame of a movie corresponds to a particular display time, based on the framerate. Given a + * time from the start of playback, this function will return the ID of the specific frame that should + * be displayed, barring any delays or skipped frames, at that time. + * + * The time, in seconds, is specified by \a count / \a unit.
+ * + * This function can be used for, among other things, jumping to a particular frame when a cuepoint is reached. + * + * \remarks + * This function can be called once the EasyPlayer handle status has reached MVEASY_STATUS_WAIT_PREP. + * + * \sa CriMvEasyPlayer::CalcTimeFromFrameId(); + */ + /*JP + * \ingroup MODULE_OPTION + * \brief 再生時刻からフレーム番号の計算 + * \param count タイマカウント + * \param unit 1秒あたりのタイマカウント値。count ÷ unit で秒単位の時刻となります。 + * \param err エラー情報(省略可) + * \return frame ID + * + * 再生時刻からフレーム番号を計算します。 + * この関数は、EasyPlayerハンドルの状態が MVEASY_STATUS_WAIT_PREP 以降になったあとに使用できます。 + * + * シーク再生開始位置を、時刻から計算したいときに使用してください。 + * (例えばキューポイント情報からシーク位置を決定する場合など。) + * + * \sa CriMvEasyPlayer::CalcTimeFromFrameId(); + */ + CriSint32 CalcFrameIdFromTime(CriUint64 count, CriUint64 unit, CriError &err=CriMv::ErrorContainer); + + /*EN + * \ingroup MODULE_OPTION + * + * \brief Calculates a frame time from a frame ID + * + * \param frame_id Frame ID + * \param unit Counter increment per second + * \param err Optional error code + * + * \return Timer counter corresponding to given frame ID + * + * Each frame of a movie corresponds to a particular display time, based on the framerate. Given a + * frame ID and the number of timer intervals per second, this function will return the timer count + * of the display time for that frame. + * + * The display time, in seconds, for this frame is calculated by dividing the timer count by the timer + * interval. + * + * If you have the movie frame, you do not have to calculate the time. The \a time and \a tunit fields + * of the CriMvFrameInfo structure that is passed the GetFrameOnTimeXXX() and DiscardNextFrame() + * functions will contain this information. + * + * \remarks + * This function can be called once the EasyPlayer handle status has reached MVEASY_STATUS_WAIT_PREP. + * + * \sa CriMvEasyPlayer::CalcFrameIdFromTime(), CriMvFrameInfo + */ + /*JP + * \ingroup MODULE_OPTION + * \brief フレーム番号から再生時刻の計算 + * \param frame_id frame ID + * \param unit 1秒あたりのタイマカウント値。count ÷ unit で秒単位の時刻となります。 + * \param err エラー情報(省略可) + * \return タイマカウント + * + * フレーム番号から再生時刻を計算します。 + * この関数は、EasyPlayerハンドルの状態が MVEASY_STATUS_WAIT_PREP 以降になったあとに使用できます。 + * + * 実際にフレーム取得した場合は、計算の必要はありません。フレーム情報構造体の時刻を参照してください。 + * + * \sa CriMvEasyPlayer::CalcFrameIdFromTime(), CriMvFrameInfo + */ + CriUint64 CalcTimeFromFrameId(CriSint32 frame_id, CriUint64 unit, CriError &err=CriMv::ErrorContainer); + + /*EN + * \ingroup MODULE_OPTION + * + * \brief Find the next event point, if any, after the given time counter + * + * \param count Timer counter + * \param unit Counter increment per second + * \param type Type of event point to look for + * \param eventinfo Returned event point information structure + * \param err Optional error code + * + * \return Frame ID corresponding to given time + * + * Event points allow an application to associate arbitrary actions with specific points in a movie. + * This function will search forward in the movie for the next event point after the given time + * (specifed as \a count / \a unit). If an event point is found, \a eventinfo will be populated with + * the information about the event point, and the function will return the corresponding frame ID. + * + * \a type is an application-defined value that can be used to categorize event points, and is specified + * when the movie is encoded (see link to event-point-specification-section for more information + * about creating event points.). If -1 is passed as the value of \a type, all event points will be + * searched. Otherwise, only matching event point types will be searched. + * + * If no event point of the requested type is found, this function will return -1. + * + * \remarks + * This function can be called once the EasyPlayer handle status has reached MVEASY_STATUS_WAIT_PREP. + * + * \sa CriMvEasyPlayer::SearchPrevEventPointByTime(); + */ + /*JP + * \ingroup MODULE_OPTION + * \brief 指定時刻直後のイベントポイントの検索 + * \param count タイマカウント + * \param unit 1秒あたりのタイマカウント値。count ÷ unit で秒単位の時刻となります。 + * \param type 検索対象とするイベントポイントのtype値 + * \param eventinfo 発見したイベントポイントの情報 + * \param err エラー情報(省略可) + * \return frame ID + * + * 指定時刻の次にあるイベントポイントを検索し、イベントポイント情報とフレーム番号を取得します。 + * この関数は、EasyPlayerハンドルの状態が MVEASY_STATUS_WAIT_PREP 以降になったあとに使用できます。 + * + * 検索の対象となるのは type で指定した値が一致するイベントポイントです。 + * type に -1を指定した場合は、全てのイベントポイントが検索対象となります。 + * + * 検索対象となるイベントポイントが発見できなかった場合は、フレーム番号は-1を返します。 + * + * \sa CriMvEasyPlayer::SearchPrevEventPointByTime(); + */ + CriSint32 SearchNextEventPointByTime(CriUint64 count, CriUint64 unit, CriSint32 type, + CriMvEventPoint &eventinfo, CriError &err=CriMv::ErrorContainer); + + /*EN + * \ingroup MODULE_OPTION + * + * \brief Find the previous event point, if any, before the given time counter + * + * \param count Timer counter + * \param unit Counter increment per second + * \param type Type of event point to look for + * \param eventinfo Returned event point information structure + * \param err Optional error code + * + * \return Frame ID corresponding to given time + * + * Event points allow an application to associate arbitrary actions with specific points in a movie. + * This function will search backward in the movie (i.e. towards the beginning) for the next event + * point before the given time (specifed as \a count / \a unit). If an event point is found, + * \a eventinfo will be populated with the information about the event point, and the function will + * return the corresponding frame ID. + * + * \a type is an application-defined value that can be used to categorize event points, and is specified + * when the movie is encoded (see link to event-point-specification-section for more information + * about creating event points.). If -1 is passed as the value of \a type, all event points will be + * searched. Otherwise, only matching event point types will be searched. + * + * If no event point of the requested type is found, this function will return -1. + * + * \remarks + * This function can be called once the EasyPlayer handle status has reached MVEASY_STATUS_WAIT_PREP. + * + * \sa CriMvEasyPlayer::SearchNextEventPointByTime(); + */ + /*JP + * \ingroup MODULE_OPTION + * \brief 指定時刻直前のイベントポイントの検索 + * \param count タイマカウント + * \param unit 1秒あたりのタイマカウント値。count ÷ unit で秒単位の時刻となります。 + * \param type 検索対象とするイベントポイントのtype値 + * \param eventinfo 発見したイベントポイントの情報 + * \param err エラー情報(省略可) + * \return frame ID + * + * 指定時刻の手前にあるイベントポイントを検索し、イベントポイント情報とフレーム番号を取得します。 + * この関数は、EasyPlayerハンドルの状態が MVEASY_STATUS_WAIT_PREP 以降になったあとに使用できます。 + * + * 検索の対象となるのは type で指定した値が一致するイベントポイントです。 + * type に -1を指定した場合は、全てのイベントポイントが検索対象となります。 + * + * 検索対象となるイベントポイントが発見できなかった場合は、フレーム番号は-1を返します。 + * + * \sa CriMvEasyPlayer::SearchNextEventPointByTime(); + */ + CriSint32 SearchPrevEventPointByTime(CriUint64 count, CriUint64 unit, CriSint32 type, + CriMvEventPoint &eventinfo, CriError &err=CriMv::ErrorContainer); + + /*EN + * \ingroup MODULE_OPTION + * + * \brief Gets the list of all event points in the movie + * + * \param err Optional error code + * + * \return Pointer to the list of event points, or NULL if there are no event points + * + * CRI Movie considers a cue point list to be the number of event points in a movie, and a pointer to + * an array of event point structures. Event points allow an application to associate arbitrary actions + * with specific points in a movie. + * + * The returned pointer points to an area inside of the EasyPlayer's work buffer. An application should + * not attempt to write to it. + * + * \remarks + * This function can be called once the EasyPlayer handle status has reached MVEASY_STATUS_WAIT_PREP. + * The returned information is valid through the MVEASY_STATUS_STOP state. Once the EasyPlayer handle + * has been destroyed, or the movie has been restarted (by calling CriMvEasyPlayer::Start(), + * CriMvEasyPlayer::Prepare(), or CriMvEasyPlayer::DecodeHeader()), the cuepoint information will be + * invalid. + * + */ + /*JP + * \ingroup MODULE_OPTION + * \brief キューポイント情報(イベントポイント一覧)の取得 + * \param err エラー情報(省略可) + * \return Cue point info (Event point list) + * + * キューポイント情報(イベントポイント一覧)を取得します。 + * この関数は、EasyPlayerハンドルの状態が MVEASY_STATUS_WAIT_PREP 以降になったあとに使用できます。 + * + * この関数で取得するキューポイント情報は、再生ハンドルのワークバッファを直接参照しています。
+ * 再生停止状態での参照は可能ですが、次の再生を開始した後は参照を禁止します。
+ * このキューポイント情報を別のメモリにコピーした場合もこの条件は変わりません。 + * + */ + CriMvCuePointInfo* GetCuePointInfo(CriError &err=CriMv::ErrorContainer); + + /*EN + * \ingroup MODULE_OPTION + * + * \brief Sets a function that will be called when a cue point is reached + * + * \param func Callback function + * \param usrobj Pointer to user-provided data + * \param err Optional error code + * + * Beginning with version 2.0, CRI Movie allows a movie to specify arbitrary actions to + * happen at various points on the timeline. These are referred to as \a cue \a points, or, + * more generally, as \a event \a points. If a cue point callback has been installed for the + * movie, it will be called whenever a cuepoint has been reached. + * + * The \a usrobj parameter specifies a pointer to arbitrary data, that will be passed as the + * third parameter to the callback. + * + * The prototype of the callback function is + * + * void callback(CriMvEasyPlayer *mveasy, CriMvEventPoint *eventinfo, void *usrobj) + * + * where + * + * mveasy is the EasyPlayer object
+ * eventinfo is the event info structure that was reached
+ * usrobj is the pointer to user data that was passed to SetFileRequestCallback().
+ * + * \remarks + * Do not call any movie playback functions (for example, CriMvEasyPlayer::Stop()) from the callback + * function. If you need to do this, set a flag from the callback and refer to it in your main loop. + * + * \sa CriMvEventPoint + */ + /*JP + * \ingroup MODULE_OPTION + * \brief キューポイントコールバック関数の登録 + * \param func キューポイントコールバック関数 + * \param usrobj ユーザオブジェクト + * \param err エラー情報(省略可) + * + * キューポイントのコールバック関数を登録します。 + * このコールバック関数は、ムービの再生時刻が各イベントポイントで指定された時刻を経過した時に発生します。 + * コールバック関数の呼び出し判定は CriMvEasyPlayer::Update() から行われます。 + * + * キューポイントコールバック発生時、コールバック関数の第2引数 eventinfo にはエベントポイント情報が、 + * 第3引数usrobjには、登録時に指定したユーザオブジェクトが渡されます。 + * + * キューポイントコールバック関数内では、ムービ再生をコントロールする関数(例えば CriMvEasyPlayer::Stop()) + * を呼び出してはいけません。 + * + * \sa CriMvEventPoint + */ + void SetCuePointCallback(void (*func)(CriMvEasyPlayer *mveasy, CriMvEventPoint *eventinfo, void *usrobj), + void *usrobj, CriError &err=CriMv::ErrorContainer); + + + /*EN + * \ingroup MODULE_OPTION + * + * \brief Resets movie handle parameters to their default values + * + * \param err Optional error code + * + * This function will reset most parameters back to their default values. Call this when you are + * reusing an EasyPlayer handle and need to quickly undo changes to a number of parameters. + * + * Note that this will not remove a subaudio interface (set by CriMvEasyPlayer::AttachSubAudioInterface()). + * CriMvEasyPlayer::DetachSubAudioInterface() must be called instead. + * + * \remarks + * This function can be called once the EasyPlayer handle status is either MVEASY_STATUS_STOP or + * MVEASY_STATUS_PLAYEND. + * + * + *
Setting API Reset by ResetAllParameters() Reset by Stop() + *
SetFile YES (*1) + *
SetData YES (*1) + *
Pause YES YES + *
SetMasterTimer YES NO + *
SetNumberOfFramePools YES NO + *
SetBufferingTime YES NO + *
SetReloadThresholdTime YES NO + *
SetMaxBitrate YES NO + *
SetAudioTrack YES NO + *
SetLoopFlag YES NO + *
SetStreamingParameters YES NO + *
AttachSubAudioInterface NO NO + *
SetSubAudioTrack YES NO + *
ReplaceCenterVoice YES NO + *
SetFileRequestCallback YES NO + *
SetSeekPosition YES NO + *
SetCuePointCallback YES NO + *
+ * + * (*1) Normally, values set by SetFile() or SetData() are not reset by a call to Stop(). However, + * if a file request callback has been set (via CriMvEasyPlayer::SetFileRequestCallback()), this + * setting will be reset. + * + * \sa CriMvEasyPlayer::Stop(), CriMvEasyPlayer::SetFileRequestCallback() + */ + /*JP + * \ingroup MODULE_OPTION + * \brief パラメータのリセット + * \param err エラー情報(省略可) + * + * 再生ハンドルに設定されたパラメータ類をリセットします。
+ * ただしサブオーディオ用インタフェースだけはリセットされませんので、アプリケーションで明示的に + * CriMvEasyPlayer::DetachSubAudioInterface() を呼び出してください。 + * + * 本関数はハンドル状態が MVEASY_STATUS_STOP または MVEASY_STATUS_PLAYEND の時に呼び出してください。 + * + * + *
設定関数 ResetAllParametersによる
リセット処理
Stopによる
リセット処理 + *
SetFile o (*1) + *
SetData o (*1) + *
Pause o o + *
SetMasterTimer o x + *
SetNumberOfFramePools o x + *
SetBufferingTime o x + *
SetReloadThresholdTime o x + *
SetMaxBitrate o x + *
SetAudioTrack o x + *
SetLoopFlag o x + *
SetStreamingParameters o x + *
AttachSubAudioInterface x x + *
SetSubAudioTrack o x + *
ReplaceCenterVoice o x + *
SetFileRequestCallback o x + *
SetSeekPosition o x + *
SetCuePointCallback o x + *
+ * (*1) 通常はリセットされません。ただしファイル要求コールバックが登録されていた場合はリセットされます。 + * + * \sa CriMvEasyPlayer::Stop() + */ + void ResetAllParameters(CriError &err=CriMv::ErrorContainer); + + /* 再生用ワークバッファおよび下位モジュールの解放(明示的な呼び出し用) */ + void ReleasePlaybackWork(CriError &err=CriMv::ErrorContainer); + +public: /* for DEBUG */ + /*//EN + * \ingroup MODULE_OPTION + * + * \brief Sets the maximum movie data read size + * + * \param max_chunk_size The maximum read size, in bytes + * \param err Optional error code + * + * This is a DEBUG function and should not normally need to be used by applications. + * + * Sets the maximum read size. CRI Movie will attempt to read this many bytes each time it + * needs to load more movie data from disk. + * + * If this function is called, it must be called before calling any of the playback functions + * (CriMvEasyPlayer::Start(), CriMvEasyPlayer::Prepare(), or CriMvEasyPlayer::DecodeHeader()). + * + * To revert to the default behavior, pass 0 as \a max_chunk_size. + * + * \remarks + * If this function is called, the new value for \a max_chunk_size will not be reflected in the + * CriMvStreapingParameters structure. A call to CriMvEasyPlayer::GetMovieInfo() will return the + * original value that was set in the movie header. + * + * \remarks + * If you call CriMvEasyPlayer::SetStreamingParameters(), this function can not be used. + * + * \sa CriMvEasyPlayer::GetMovieInfo(), CriMvEasyPlayer::SetMinBufferSize() + */ + /*//JP + * \ingroup MODULE_OPTION + * \brief 最大チャンクサイズの指定 + * \param max_chunk_size 最大チャンクサイズ[byte] + * \param err エラー情報(省略可) + * + * ムービデータの最大チャンクサイズを指定します。
+ * 現在のライブラリでは、本関数はアプリケーションから使用する必要はありません。
+ * + * 本関数で設定した最大チャンクサイズは、CriMvEasyPlayer::GetMovieInfo 関数で取得するムービ情報には反映されません。 + * CriMvEasyPlayer::GetMovieInfo 関数で取得できるのはムービデータの本来の情報です。
+ * + * 本関数の呼び出しは、 CriMvEasyPlayer::Prepare 関数または CriMvEasyPlayer::Start 関数の前までに実行してください。 + * + * 最大チャンクサイズに 0を指定した場合、最大チャンクサイズはムービデータの持つ値となります。
+ * また、アプリケーションが CriMvEasyPlayer::SetStreamingParameters 関数を呼び出した場合は本関数で + * 設定した値よりも、 CriMvEasyPlayer::SetStreamingParameters 関数の指定が優先されます。 + * + * \sa CriMvEasyPlayer::GetMovieInfo(), CriMvEasyPlayer::SetMinBufferSize() + */ + void SetMaxChunkSize(CriUint32 max_chunk_size, CriError &err=CriMv::ErrorContainer); + + /*//EN + * \ingroup MODULE_OPTION + * + * \brief Sets the minimum movie data buffer size + * + * \param min_buffer_size The minimum buffer size, in bytes + * \param err Optional error code + * + * This is a DEBUG function and should not normally need to be used by applications. + * + * Sets the minimum buffer size used for reading movie data from disk. + * + * If this function is called, it must be called before calling any of the playback functions + * (CriMvEasyPlayer::Start(), CriMvEasyPlayer::Prepare(), or CriMvEasyPlayer::DecodeHeader()). + * + * To revert to the default behavior, pass 0 as \a max_chunk_size. + * + * \remarks + * If this function is called, the new value for \a min_buffer_size will not be reflected in the + * CriMvStreapingParameters structure. A call to CriMvEasyPlayer::GetMovieInfo() will return the + * original value that was set in the movie header. + * + * \remarks + * If you call CriMvEasyPlayer::SetStreamingParameters(), this function can not be used. + * + * \sa CriMvEasyPlayer::GetMovieInfo(), CriMvEasyPlayer::SetMaxChunkSize() + */ + /*//JP + * \ingroup MODULE_OPTION + * \brief 最小バッファサイズの指定 + * \param min_buffer_size 最小バッファサイズ[byte] + * \param err エラー情報(省略可) + * + * ムービデータの最小バッファサイズを指定します。
+ * 現在のライブラリでは、本関数はアプリケーションから使用する必要はありません。
+ * + * 本関数で設定した最小バッファサイズは、CriMvEasyPlayer::GetMovieInfo 関数で取得するムービ情報には反映されません。 + * CriMvEasyPlayer::GetMovieInfo 関数で取得できるのはムービデータの本来の情報です。
+ * + * 本関数の呼び出しは、 CriMvEasyPlayer::Prepare 関数または CriMvEasyPlayer::Start 関数の前までに実行してください。 + * + * 最小バッファサイズに 0を指定した場合、最小バッファサイズはムービデータの持つ値となります。
+ * また、アプリケーションが CriMvEasyPlayer::SetStreamingParameters 関数を呼び出した場合は本関数で + * 設定した値よりも、 CriMvEasyPlayer::SetStreamingParameters 関数の指定が優先されます。 + * + * \sa CriMvEasyPlayer::GetMovieInfo(), CriMvEasyPlayer::SetMaxChunkSize() + */ + void SetMinBufferSize(CriUint32 min_buffer_size, CriError &err=CriMv::ErrorContainer); + + /*EN + * \ingroup MODULE_OPTION + * + * \brief Retrieves various movie playback statistics + * + * \param playinfo Playback statistics structure + * \param err Optional error code + * + * This is a DEBUG function and is not normally needed by applications. + * + * Retrieves a number of performance statistics dealing with movie playback, including how often + * a frame could not be retrieved and how close the plaback framerate is to the movie's expected + * playback. + * + * This information is updated on every call to CriMvEasyPlayer::IsNextFrameOnTime(). In order for + * the values to be accurate, an application should call IsNextFrameOnTime() once each time through + * its main loop. Calling IsNextFrameOnTime() too often or not often enough will result in + * misleading statistics. + * + * \sa CriMvEasyPlayer::IsNextFrameOnTime() + */ + /*JP + * \ingroup MODULE_OPTION + * \brief ムービ再生情報の取得 + * \param playinfo ムービ情報(返り値) + * \param err エラー情報(省略可) + * + * 本関数は通常、アプリケーションからは使用しません。デバッグ用の関数です。 + * + * 現在再生しているムービの再生情報 CriMvPlaybackInfo 構造体を取得できます。
+ * この情報からビデオフレームの取得間隔や、ビデオフレームのデコード遅延などを知ることができます。
+ * + * 再生情報はアプリが呼び出す CriMvEasyPlayer::IsNextFrameOnTime() 内で更新します。
+ * アプリケーションが CriMvEasyPlayer::IsNextFrameOnTime()を呼び出さない場合や、メインループで複数回 + * 呼び出す場合は情報が正しく更新されないので注意してください。
+ * + * \sa CriMvEasyPlayer::IsNextFrameOnTime() + */ + void GetPlaybackInfo(CriMvPlaybackInfo & playinfo, CriError & err = CriMv::ErrorContainer); + + /*EN + * \ingroup MODULE_OPTION + * + * \brief Gets the result of the last attempt to retrieve a video frame + * + * \param err Optional error code + * + * \return The result of the last frame retrieval + * + * Returns one of the following values: + * + * + * + * + * + * + * + *
Value Meaning
CRIMV_LASTFRAME_OK The frame was successfully retrieved.
CRIMV_LASTFRAME_TIME_EARLY It is too soon to display this frame. The frame time + * is greater than the current playback time.
CRIMV_LASTFRAME_DECODE_DELAY The frame has not been decoded yet, or CRI Movie is not + * done decoding it.
CRIMV_LASTFRAME_DISCARDED The frame was discarded, by calling + * CriMvEasyPlayer::DiscardNextFrame()
+ * + * \remarks + * The result is determined by calling CriMvEasyPlayer::IsNextFrameOnTime(), not the GetFrameOnTimeXXX() + * functions. + * + * \sa CriMvEasyPlayer::IsNextFrameOnTime(), CriMvEasyPlayer::DiscardNextFrame() + */ + /*JP + * \ingroup MODULE_OPTION + * \brief 前回のビデオフレーム取得の結果を取得する + * \param err エラー情報(省略可) + * \return フレーム取得結果の列挙値 + * + * 本関数は通常、アプリケーションからは使用しません。デバッグ用の関数です。 + * + * 前回のビデオフレーム取得の結果を返します。 + * ビデオフレームのデコードが間に合っているのかどうかをチェックすることが出来ます。 + * + * 注意:
+ * ビデオフレーム取得の結果とは、基本的にアプリケーションが呼び出す CriMvEasyPlayer::IsNextFrameOnTime() の結果を元に + * 更新します。GetFrameOnTime関数の結果ではありません。 + * + * \sa CriMvEasyPlayer::IsNextFrameOnTime() + */ + CriMvLastFrameResult GetLastFrameResult(CriError & err = CriMv::ErrorContainer); + + /* [Unofficial] */ + /* Set the number of decoded frames to keep internally during the MVEASY_STATUS_PREP status. */ + /* Adjust the number if you need to reduce latesy for the first frame */ + void SetNumberOfFramesForPrep(CriUint32 num_frames, CriError & err = CriMv::ErrorContainer); + + /* [Unofficial] + * \ingroup MODULE_OPTION + * \brief 再生終了/停止通知コールバック関数の登録 + * \param func 再生終了/停止通知コールバック関数 + * \param usrobj ユーザオブジェクト + * \param err エラー情報(省略可) + * + * 再生終了および再生停止を通知するコールバック関数を登録します。 + * このコールバック関数は、ヘッダ解析/再生準備/再生状態から再生停止/再生終了状態に + * 遷移した直後に一度だけ呼び出されます。 + * コールバック関数の呼び出しは CriMvEasyPlayer::Update() から行われます。 + * + * 登録したコールバック関数内では、ムービ再生をコントロールする関数(例えば CriMvEasyPlayer::Stop()) + * を呼び出してはいけません。 + * + * 注意: MVEASY_STATUS_PLAYEND状態からMVEASY_STATUS_STOP状態への遷移時にはコールバック関数は呼び出されません。 + */ + void SetStopCompleteCallback(void (*func)(CriMvEasyPlayer *mveasy, void *usrobj), + void *usrobj, CriError &err=CriMv::ErrorContainer); + + /* For FAST_LATENCY */ + /*************************************************************************************/ + /* コンフィグ指定のハンドル作成関数 */ + static CriMvEasyPlayer* CRIAPI Create(CriHeap heap, + CriMvHandleConfig *config, + CriMvFileReaderInterface *freader, + CriMvSystemTimerInterface *stimer, + CriMvSoundInterface *sound, + CriError &err=CriMv::ErrorContainer); + + /* For Sofdec2 */ + /*************************************************************************************/ + enum MetaFlag { + MVEASY_META_FLAG_CUE = 0x0001, + MVEASY_META_FLAG_SEEK = 0x0002, + MVEASY_META_FLAG_ALL = MVEASY_META_FLAG_CUE + MVEASY_META_FLAG_SEEK, + + /* Keep enum 4bytes */ + MVEASY_META_FLAG_MAKE_ENUM_SINT32 = 0x7FFFFFFF + }; + + enum ReferFrameResult { + MVEASY_REFER_FRAME_RESULT_OK = (1), + MVEASY_REFER_FRAME_RESULT_SHORT_INPUT = (2), + MVEASY_REFER_FRAME_RESULT_SHORT_CPUTIME = (3), + MVEASY_REFER_FRAME_RESULT_DEMUX_STUCK = (4), + + /* Keep enum 4bytes */ + MVEASY_REFER_FRAME_RESULT_MAKE_ENUM_SINT32 = 0x7FFFFFFF + }; + + /* ユーザからのワーク領域渡し版、ハンドル作成関数 */ + static CriMvEasyPlayer* CRIAPI Create(void *work, CriSint32 work_size, + CriMvHandleConfig *config, + CriMvFileReaderInterface *freader, + CriMvSystemTimerInterface *stimer, + CriMvSoundInterface *sound, + CriError &err=CriMv::ErrorContainer); + + /* 再生用ワーク領域サイズの計算 */ + CriSint32 CalcPlaybackWorkSize(const CriMvStreamingParameters *stmprm, CriError & err = CriMv::ErrorContainer); + + /* 再生用ワーク領域の設定関数 */ + void SetPlaybackWork(void *work, Sint32 work_size, CriError & err = CriMv::ErrorContainer); + + /* メタデータワーク用コールバック関数 */ + void SetMetaDataWorkAllocator(CriMvMetaDataWorkMallocFunc allocfunc, CriMvMetaDataWorkFreeFunc freefunc,void *usrobj, CriMvMetaFlag meta_flag); + + /* 引数で指定したフレーム情報の表示判定 */ + CriBool IsFrameOnTime(const CriMvFrameInfo *frameinfo, CriError &err=CriMv::ErrorContainer); + + /* フレームの参照 */ + ReferFrameResult ReferFrame(CriMvFrameInfo &frameinfo, CriError &err=CriMv::ErrorContainer); + + /* YUV個別バッファフォーマットでのバッファ取得 */ + CriBool LockFrameYUVBuffersWithAlpha(CriMvYuvBuffers &yuvbuffers, CriMvFrameInfo &frameinfo, CriMvAlphaFrameInfo &alpha_frameinfo, CriError &err=CriMv::ErrorContainer); + + /* LockFrameYUVBuffersWithAlphaでロックしたフレームの解放 */ + CriBool UnlockFrameBufferWithAlpha(CriMvFrameInfo *frameinfo, CriMvAlphaFrameInfo *alpha_frameinfo, CriError &err=CriMv::ErrorContainer); + + /* 32bitARGBバッファフォーマットへのコピー関数 */ + CriBool CopyFrameToBufferARGB32(CriUint8 *dstbuf, CriUint32 dst_pitch, CriUint32 dst_bufsize, + const CriMvYuvBuffers *srcbufs, const CriMvFrameInfo *src_vinf, const CriMvAlphaFrameInfo *src_ainf, CriError &err=CriMv::ErrorContainer); + + /* 32bitARGBバッファフォーマットへαのみのコピー関数 */ + CriBool CopyAlphaToBufferARGB32( + const CriMvFrameInfo *src_vinf, + CriUint8 *dst_buf, + CriUint32 dst_pitch, + CriUint32 dst_bufsize, + CriError &err=CriMv::ErrorContainer + ); + +#if defined(XPT_TGT_IPHONE) || defined(XPT_TGT_WINMO) || defined(XPT_TGT_ANDROID) || defined(XPT_TGT_CQSH2A) || defined(XPT_TGT_ACRODEA) || defined(XPT_TGT_NACL) || defined(XPT_TGT_SH7269) || defined(XPT_TGT_PC)|| defined(XPT_TGT_TRGP6K) + CriBool CopyFrameToBufferRGB565(CriUint8 *dstbuf, CriUint32 dst_pitch, CriUint32 dst_bufsize, + const CriMvYuvBuffers *srcbufs, const CriMvFrameInfo *src_vinf, const CriMvAlphaFrameInfo *src_ainf, CriError &err=CriMv::ErrorContainer); +#endif + + /* YUV個別バッファフォーマットのコピー関数 */ + CriBool CopyFrameToBuffersYUV(CriMvYuvBuffers *dstbufs, + const CriMvFrameInfo *src_vinf, const CriMvAlphaFrameInfo *src_ainf, CriError &err=CriMv::ErrorContainer); + + /* リードバッファサイズの強制指定 */ + void SetReadBufferSize(CriUint32 buffer_size, CriError &err=CriMv::ErrorContainer); + + CriUint32 GetMinBufferSize(CriError &err=CriMv::ErrorContainer); + /**************************************************************************************/ + void SetVideoFramerate(CriUint32 framerate_n, CriUint32 framerate_d); + + void SetCompareFrameTimeCallback( + CriBool (*func)(CriMvEasyPlayer *mveasy, CriMvFrameInfo *frameinfo, CriUint64 count, CriUint64 unit, void *usrobj), + void *usrobj, CriError &err=CriMv::ErrorContainer); + void SetSeekFrameAndOffset(CriSint32 seek_frame_id, CriUint64 seek_byte, CriError &err=CriMv::ErrorContainer); + + enum InputMode { + MVEASY_INPUT_UNDEFINED, + MVEASY_INPUT_STREAMING, /* メモリストリーミング */ + MVEASY_INPUT_MEMORY, /* メモリ直接参照(ユニSJ) */ + + /* Keep enum 4bytes */ + MVEASY_INPUT_MAKE_ENUM_SINT32 = 0x7FFFFFFF + }; + /* 実験中: この関数のために InputMode 定義を暫定でpublicへ移動 */ + void SetMemoryPlaybackType(InputMode memplay_type, CriError &err=CriMv::ErrorContainer); + + /* デコードスキップの自動実行モード */ + //void SetAutoSkipDecode(CriBool sw, CriFloat32 margin_msec, CriError &err=CriMv::ErrorContainer) + + /* ファイル要求の再コールバック要求 */ + void DeferFileRequest(CriError &err=CriMv::ErrorContainer); + + /* for specific use */ + void SetHeaderAndBodyData(const CriUint64Adr header_ptr, CriSint64 header_size, + const CriUint64Adr body_ptr, CriSint64 body_size); + CriSint32 CalcFramepoolWorkSize(const CriMvStreamingParameters *stmprm, CriError & err = CriMv::ErrorContainer); + void SetFramepoolWork(void *work, CriSint32 work_size, CriError & err = CriMv::ErrorContainer); + void SetFramepoolWorkAllocator(CriMvFramepoolWorkMallocFunc allocfunc, CriMvFramepoolWorkFreeFunc freefunc, void *usrobj); + void SetCapacityOfPictureSize(CriSint32 video_picsize, CriSint32 alpha_picsize, CriError &err); + void GetUsrCapacityOfPictureSize(CriSint32 *video_picsize, CriSint32 *alpha_picsize); + void SetMaxMovieSize(CriUint32 max_width, CriUint32 max_height, CriError &err); + void GetMaxMovieSize(CriUint32 *max_width, CriUint32 *max_height); + CriBool PlaybackResourceAllocated() const; + CriBool CanReusePlaybackResource(const CriMvStreamingParameters *stmprm) const; + CriBool GetReusePlaybackResourceFlag() const; + +private: + /* CRI internal use only */ + + void initializeHandleParameters(void); + void initializeCompareFrameParameters(void); + void resetHandleParameters(void); + CriBool startInputAndDecoding(void); + CriBool isEndReadFile(void); + void reinputDataForLooping(void); + void executeFileCloseServer(void); + void supplyDataFromStreamer(void); + void executeFileReadServer(void); + void executeFileOpenServer(void); + void executeCuePointServer(void); + //void executeAutoSkipDecode(void); + void executeWaitStatusServer(CriError &err = CriMv::ErrorContainer); + void surveilTerminationInput(void); + CriBool isAvailableCenterVoice(const CriMvStreamingParameters *stmprm); + CriBool isAvailableSubAudio(const CriMvStreamingParameters *stmprm); + CriBool attachCenterVoice(void); + void detachCenterVoice(void); + + CriBool attachSubAudioHandle(CriHeap heap); + void detachSubAudioHandle(void); + + void getAudioTime(CriUint64 &out_count, CriUint64 &out_unit, CriUint64 s_count, CriUint64 s_unit); + + CriBool allocAndCreateModules(void); + void startModules(void); + void requestStopModules(void); + CriBool closeFileIfOpening(void); + CriBool isCompleteStopModules(void); + void tryCleanupModules(CriMvPlyStatus mvstat); + CriBool tryFreeAndDestroySubmodules(void); + void freeAndDestroyModules(void); + + CriUint32 adjustNumTrackAudioOut(void); + + /* ストリーミング用のパラメータ取得 */ + /* GetMovieInfo()との違いはユーザ指定値がどこまで反映されるか。 + * 例えば、最大チャンクサイズはこの関数ではユーザ指定値をとるが、GetMovieInfoだとファイルの値。 + * この関数は、内部で下位モジュール作成およびメモリ確保する時に使う。 */ + CriBool GetStreamingParameters(CriMvStreamingParameters &stmprm, CriError &err=CriMv::ErrorContainer); + + void setNormalErrorStatus(const CriChar8 *errmsg); + + CriBool compareFrameTimeSimple(CriMvEasyPlayer *mveasy, CriMvFrameInfo *frameinfo, CriUint64 count, CriUint64 unit, void *usrobj); + static CriBool compareFrameTimeFluctuation(CriMvEasyPlayer *mveasy, CriMvFrameInfo *frameinfo, CriUint64 count, CriUint64 unit, void *usrobj); + + Bool isNextFrameOnTime(CriBool update_stats, CriError &err); + Bool checkFrameTime(CriMvFrameInfo *frameinfo); + void updateGetFrameInfo(CriBool time_ready, CriBool acquired_frame, CriBool discard_frame, CriUint64 frame_count, CriUint64 frame_unit); + + /* for DEBUG */ + void crimveasy_SetSeekInfo(void); + + void executeUpdate(CriError &err); + +private: + static CriUint32 crimveasy_SupplyPcmDataByFloat32(void *obj, CriUint32 nch, CriFloat32 *pcmbuf[], CriUint32 req_nsmpl); + static CriUint32 crimveasy_SupplyPcmDataBySint16(void *obj, CriUint32 nch, CriSint16 *pcmbuf[], CriUint32 req_nsmpl); + static CriUint32 crimveasy_CalcAvailableNumSmpls(CriMvEasyPlayer *mveasy); + static CriUint32 crimveasy_GetWave16(CriMvEasyPlayer *mveasy, CriUint32 nch, CriSint16 *pcmbuf[], CriUint32 req_nsmpl); + static CriUint32 crimveasy_GetWave32(CriMvEasyPlayer *mveasy, CriUint32 nch, CriFloat32 *pcmbuf[], CriUint32 req_nsmpl); + + static CriUint32 crimveasy_SupplySubAudioDataByFloat32(void *obj, CriUint32 nch, CriFloat32 *pcmbuf[], CriUint32 req_nsmpl); + static CriUint32 crimveasy_GetSubAudioWave32(CriMvEasyPlayer *mveasy, CriUint32 nch, CriFloat32 *pcmbuf[], CriUint32 req_nsmpl); + static CriUint32 crimveasy_SupplySubAudioDataBySint16(void *obj, CriUint32 nch, CriSint16 *pcmbuf[], CriUint32 req_nsmpl); + static CriUint32 crimveasy_GetSubAudioWave16(CriMvEasyPlayer *mveasy, CriUint32 nch, CriSint16 *pcmbuf[], CriUint32 req_nsmpl); + +public: + CriMvPly mvply; /* Temporally allowed to access for debug */ + +private: + CriHeap heap; + CriBool user_stmprm_flag; + CriMvStreamingParameters stmprm; + CriBool alloced_submodules_flag; + CriMvFrameInfo frameinfo; + CriMvAlphaFrameInfo alpha_frame; + CriMvFileReaderInterface *freader; + CriMvSoundInterface *sndout; + CriMvSystemTimerInterface *stimer; + TimerType timertype; + Status pre_ezstat; + CriBool req_decode_header_flag; + CriBool req_prepare_flag; + CriBool pause_flag; + CriUint32 npools; + CriSint32 track_play_audio; + CriUint32 num_track_audio_data; + CriUint32 num_track_audio_out; + CriBool loop_flag; + CriUint64 time_count; + CriUint64 time_unit; + CriSint64 total_read; + CriSint64 fsize_byte; + CriChunk read_crick; + CriBool exe_open; + CriBool exe_close; + CriBool exe_read; + + CriUint64 time_syslog_count; /* システムタイマの記録 */ + CriUint64 time_syslog_unit; + CriUint64 time_ofs_count; /* オーディオ終了時のシステムタイマ */ + CriUint64 time_ofs_unit; + CriUint64 time_prev_audio_count; /* オーディオ時刻変化チェック用 */ + CriUint64 time_prev_audio_unit; + + CriFloat32 user_buffering_sec; /* 0.0f means AUTO */ + CriUint32 user_max_bitrate; /* 0 means AUTO */ + CriUint32 user_max_chunk_size; /* 0 means AUTO */ + CriUint32 user_min_buffer_size; /* 0 means AUTO */ + CriSint32 user_read_buffer_size; /* CRIMV_READ_BUFFER_SIZE_AUTO means AUTO */ + CriSint32 user_video_capacity_of_picsize; /* 0 means AUTO */ + CriSint32 user_alpha_capacity_of_picsize; /* 0 means AUTO */ + CriUint32 user_max_width; + CriUint32 user_max_height; + + CriSint32 usr_subtitle_channel; + CriMvSubtitleInfo sbtinfo; + CriFloat32 sbt_start_msec; + CriFloat32 sbt_end_msec; + CriUint8 *sbtbuf; + + enum InputSrc { + MVEASY_INPUT_SRC_UNDEFINED, + MVEASY_INPUT_SRC_FILE, + MVEASY_INPUT_SRC_MEMORY, + /* Keep enum 4bytes */ + MVEASY_INPUT_SRC_MAKE_ENUM_SINT32 = 0x7FFFFFFF + }; + InputSrc input_src; + CriMvFileReaderInterface *ext_reader; + CriMvFileReaderInterface *mem_reader; + + enum InputSupplyStatus { + MVEASY_SUPPLY_STOP, + MVEASY_SUPPLY_REQ_OPEN, + MVEASY_SUPPLY_OPENING, + MVEASY_SUPPLY_READING, + MVEASY_SUPPLY_REQ_CLOSE, + MVEASY_SUPPLY_CLOSING, + + /* Keep enum 4bytes */ + MVEASY_SUPPLY_MAKE_ENUM_SINT32 = 0x7FFFFFFF + }; + + InputMode memplay_type; /* メモリ再生をストリームするかユニSJするか */ + InputMode input_mode; + InputSupplyStatus supply_stat; + CriBool change_file_mode; + CriChar8 file_name[CRIMV_MAX_FILE_NAME]; + CriUint64 file_offset; + CriSint64 file_range; + CriUint8 *dataptr; + CriUint32 datasize; + CriBool terminate_flag; + CriSint32 reinput_cnt; + + enum NextEntryState { + MVEASY_NEXT_ENTRY_NONE, + MVEASY_NEXT_ENTRY_READY, + MVEASY_NEXT_ENTRY_DEFER, + /* Keep enum 4bytes */ + MVEASY_NEXT_ENTRY_MAKE_ENUM_SINT32 = 0x7FFFFFFF + }; + NextEntryState next_entry_state; + + CriUint32 center_ch; + CriSint32 usr_voice_track; // by SetCenterVoice() + CriSint32 voice_attached_track; + + // Sub Audio + CriMvSoundInterface *if_subaudio; + CriSint32 usr_subaudio_track; + CriSint32 attached_subaudio_track; + + void (*cbfunc_file_request)(CriMvEasyPlayer *mveasy, void *usrobj); + void *usrobj_file_request; + + CriBool (*cbfunc_compare_ftime)(CriMvEasyPlayer *mveasy, CriMvFrameInfo *frameinfo, CriUint64 count, CriUint64 unit, void *usrobj); + void *usrobj_compare_ftime; + + /* Seek Playback */ + CriSint32 seek_frame_id; + CriUint64 seek_byte; + + /* CuePoint */ + void (*cbfunc_cuepoint)(CriMvEasyPlayer *mveasy, CriMvEventPoint *eventinfo, void *usrobj); + void *usrobj_cuepoint; + + /* Playback Statistics */ + CriBool start_getfrm; + CriUint64 last_getfrm_count; + CriFloat32 sum_diff_time; + CriMvPlaybackInfo playinfo; + CriMvLastFrameResult last_frm_result; + + /* Block flag for simultanious calls on multi-threads */ + CriSint32 execute_decode_block_flag; + CriSint32 update_block_flag; + + /* Stop Completion Notification */ + void (*cbfunc_stopcomplete)(CriMvEasyPlayer *mveasy, void *usrobj); + void *usrobj_stopcomplete; + + /* For Sofdec2 */ + void *playback_work; + CriSint32 playback_work_size; + void *mvply_work; + CriHeap heap_mveasy; + CriHeap heap_extra_sound; + CriBool reuse_modules_flag; + + /* For Debug */ + volatile CriUint8 end_sequence_info; + + /* Handle Protection */ + void *cshn; + void *cs_work; + + /* Skip Decoding */ + //CriBool skip_auto_flag; + //CriFloat32 margin_msec; + +public: + enum FrameCompareMode { + MVEASY_COMPARE_MODE_JUST, /* 正確に時刻比較する */ + MVEASY_COMPARE_MODE_DELAY_GET, /* タイマ時刻を前倒し=フレームはなるべく渡さない */ + MVEASY_COMPARE_MODE_FAST_GET, /* タイマ時刻を水増し=フレームはなるべく渡す */ + + /* Keep enum 4bytes */ + MVEASY_COMPARE_MODE_MAKE_ENUM_SINT32 = 0x7FFFFFFF + }; + FrameCompareMode compare_mode; + CriFloat32 accuracy_system_tmr_msec; /* システム時刻精度 milli sec */ + CriFloat32 accuracy_audio_tmr_msec; /* オーディオ時刻精度 milli sec */ + CriFloat32 fluctuation_system; /* システム(SyncFrame)の揺らぎ milli sec */ + CriFloat32 fluctuation_adjust; /* 揺らぎ補正 */ +// CriFloat32 fluctuation_system_msec; /* システム時刻ゆらぎ幅 milli sec */ +// CriFloat32 fluctuation_audio_msec; /* オーディオ時刻ゆらぎ幅 milli sec */ +// CriFloat32 fluctuation_adjust; /* ゆらぎ補正倍率 */ +// CriSint32 fluctuation_system_usec; /* システム時刻ゆらぎ幅 micro sec */ +// CriSint32 fluctuation_audio_usec; /* オーディオ時刻ゆらぎ幅 micro sec */ +// CriFloat32 fluctuation_adjust_multi; /* ゆらぎ補正倍率 */ +// CriSint32 fluctuation_adjust_add; /* ゆらぎ補正オフセット */ + +private: + CriBool req_stop_modules; + CriBool error_flag; + CriBool req_start_modules; + +protected: + CriMvEasyPlayer(CriHeap heap, + CriMvFileReaderInterface *freader, + CriMvSystemTimerInterface *stimer, + CriMvSoundInterface *sound, + CriError &err=CriMv::ErrorContainer); + virtual ~CriMvEasyPlayer(); + +private: + CriMvEasyPlayer(void); //disabled +}; + + + + +#endif /* CRI_MOVIE_H_INCLUDED */ diff --git a/3rdParty/cri/pc/include/cri_movie_core.h b/3rdParty/cri/pc/include/cri_movie_core.h new file mode 100644 index 00000000..838788e7 --- /dev/null +++ b/3rdParty/cri/pc/include/cri_movie_core.h @@ -0,0 +1,2554 @@ +/**************************************************************************** + * + * CRI Middleware SDK + * + * Copyright (c) 2005-2013 CRI Middleware Co., Ltd. + * + * Library : CRI Movie + * Module : Library User's Header + * File : cri_movie_core.h + * Date : 2013-11-21 + * Version : (see CRIMVPLY_VER) + * + ****************************************************************************/ +/*! + * \file cri_movie_core.h + */ +#ifndef CRI_MOVIE_CORE_H_INCLUDED /* Re-definition prevention */ +#define CRI_MOVIE_CORE_H_INCLUDED + +/* Version No. */ +#define CRIMVPLY_VER "3.50" +#define CRIMVPLY_NAME "criMvPly" + +/*************************************************************************** + * Include file + ***************************************************************************/ +#include +#include +#include + +/*************************************************************************** + * MACRO CONSTANT + ***************************************************************************/ + +/*EN + * \brief Audio OFF setting of Audio Track + * \ingroup MDL_MV_OPTION + * \sa CriMvEasyPlayer::SetAudioTrack() + */ +/*JP + * \brief オーディオ再生OFFの指定値 + * \ingroup MDL_MV_OPTION + * \sa CriMvEasyPlayer::SetAudioTrack() + */ +#define CRIMV_AUDIO_TRACK_OFF (-1) + +/*EN + * \brief Default setting of Audio Track + * \ingroup MDL_MV_OPTION + * \sa CriMvEasyPlayer::SetAudioTrack() + */ +/*JP + * \brief オーディオチャネルのデフォルト値 + * \ingroup MDL_MV_OPTION + * \sa CriMvEasyPlayer::SetAudioTrack() + */ +#define CRIMV_AUDIO_TRACK_AUTO (100) + +/*EN + * \brief Maximum number of PCM tracks in one audio stream + * \ingroup MDL_MV_OPTION + */ +/*JP + * \brief オーディオデータ内の最大PCMトラック数 + * \ingroup MDL_MV_OPTION + */ +#define CRIMV_PCM_BUFFER_MAX (8) + +/*EN + * \brief Subtitle OFF setting + * \ingroup MDL_MV_OPTION + * \sa CriMvEasyPlayer::SetSubtitleChannel() + */ +/*JP + * \brief 字幕再生OFFの指定値 + * \ingroup MDL_MV_OPTION + * \sa CriMvEasyPlayer::SetSubtitleChannel() + */ +#define CRIMV_SUBTITLE_CHANNEL_OFF (-1) + +/*EN + * \brief Maximum number of video tracks in a movie file + * \ingroup MDL_MV_OPTION + */ +/*JP + * \brief ムービファイル内の最大ビデオストリーム数 + * \ingroup MDL_MV_OPTION + */ +#define CRIMV_MAX_VIDEO_NUM (1) + +/*EN + * \brief Maximum number of audio tracks in a movie file + * \ingroup MDL_MV_OPTION + */ +/*JP + * \brief ムービファイル内の最大オーディオストリーム数 + * \ingroup MDL_MV_OPTION + */ +#define CRIMV_MAX_AUDIO_NUM (32) + +/*EN + * \brief Maximum number of alpha tracks in a movie file + * \ingroup MDL_MV_OPTION + */ +/*JP + * \brief ムービファイル内の最大アルファストリーム数 + * \ingroup MDL_MV_OPTION + */ +#define CRIMV_MAX_ALPHA_NUM (1) + +#if defined(XPT_TGT_PC) +/*EN + * \brief Number of extra threads for multicore decoding + * \ingroup MDL_MV_OPTION + * The number of additional decoding threads that CRI Movie library internally creates. + * The threads are intended to run on multiple processors in parallel. + * \sa CriMvEasyPlayer::SetUsableProcessors_PC() + */ +/*JP + * \brief マルチコアデコード用の追加のデコードスレッド数 + * \ingroup MDL_MV_OPTION + * CRI Movieライブラリが内部で作成する追加のデコードの数です。これらのスレッドは、マルチコアPC上で + * デコード処理を並列分散させるために作られます。 + * \sa CriMvEasyPlayer::SetUsableProcessors_PC() + */ +#define CRIMV_NUM_EXT_DECTHREAD_PC (3) + +/*EN + * \brief Default affnity mask of a thread + * \ingroup MDL_MV_OPTION + * \sa CriMvEasyPlayer::SetUsableProcessors_PC() + */ +/*JP + * \brief スレッドアフィニティマスクのデフォルト設定値 + * \ingroup MDL_MV_OPTION + * \sa CriMvEasyPlayer::SetUsableProcessors_PC() + */ +#define CRIMV_DEFAULT_AFFNITY_MASK_PC (0xFFFFFFFF) + + +/*EN + * \brief Default priority of a thread + * \ingroup MDL_MV_OPTION + * \sa CriMvEasyPlayer::SetUsableProcessors_PC() + */ +/*JP + * \brief スレッドのデフォルト優先度 + * \ingroup MDL_MV_OPTION + * \sa CriMvEasyPlayer::SetUsableProcessors_PC() + */ +#define CRIMV_DEFAULT_THREAD_PRIORITY_PC (0x8000000) +#endif + +/*EN + * \brief Default value of the read buffer size + * \ingroup MDL_MV_OPTION + * \sa CriMvEasyPlayer::SetReadBufferSize() + */ +/*JP + * \brief リードバッファサイズをデフォルト値 + * \ingroup MDL_MV_OPTION + * \sa CriMvEasyPlayer::SetReadBufferSize() + */ +#define CRIMV_READ_BUFFER_SIZE_AUTO (-1) + + +/*************************************************************************** + * Library Spec Defenition + ***************************************************************************/ + +/* */ + +/* 2007-09-06:URUSHI オーディオ処理のサブモジュール化 * + * MvPlyのオーディオ処理部分をCriMvPlyAmngという新たなクラスに切り出す。* + * CriMvPlyAmngはデマルチプレクサから全トラックデータを受け取って、 * + * トラックごとに割り振られたAdecに処理を渡します。 * + * 目的は以下の二つ * + * 1) オーディオトラックの動的切替 * + * 2) ループ再生での異なるAV尺の同期 */ + +#define NUM_MAX_ADEC (2) /* Adecの最大数 */ +/* ADECのインデックス定義 */ +/* このindexを使ってCriMvPlyAmngからAdecをコントロールしてください。 */ +#define MAIN_ADEC_IDX (0) // メイントラック用 +#define SUB_ADEC_IDX (1) // ボイストラック用 + +/* オーディオの動的切替機能をサポートするか */ +//#define ENABLE_DYNAMIC_AUDIO_SWITCH + +#if defined(ENABLE_DYNAMIC_AUDIO_SWITCH) + #define CRIMVPLYAMNG_TRACK_OFF (512) // 切り替え先トラック番号のデフォルト値(切替OFF) + + /* トラックの動的切替のための状態定義 */ + typedef enum _crimvplyamng_track_state { + CRIMVPLYAMNG_TRACK_STATE_FIXED = (1), // デフォルト + CRIMVPLYAMNG_TRACK_STATE_PREP_SWITCHING, // ユーザが切替を命令し、切替の準備段階(時刻判定のための基準時間をセット) + CRIMVPLYAMNG_TRACK_STATE_SWITCHING // 切替元と先の時刻判定を行なって切替を行なう状態 + } CriMvPlyAmngTrackState; +#endif + +/* 連結再生時、2個目以降のヘッダを取得できるようにするため */ +#define CRIMVPLY_HEAD_CONTAINER_NUM (2) + +/* 再読み込み閾値のデフォルト値 */ +#define CRIMV_DEFAULT_RELOAD_THRESHOLD (0.8f) // 0.8[sec] + +/* 再生準備中の貯金フレーム数デフォルト値 */ +#define CRIMV_DEFAULT_NUM_FRAMES_FOR_PREP (-1) /* デフォルト:不使用 (フレームプール数を採用) */ + +/* 内部ワーク領域の確保にCRI Heapを使用しない */ +#define CRIMV_REMOVE_CRIHEAP + +/* 機種固有フレーム情報数 */ +#define CRIMV_FRAME_DETAILS_NUM (2) + +/* CriVavfios で指定する外部ファイルのパスの上限 */ +#if defined(XPT_TGT_IOS) + #define CRIMVPLY_VAVFIOS_MAX_FILEPATH (256) +#endif + +/*************************************************************************** + * Process MACRO + ***************************************************************************/ +#define criMv_SetDefaultHandleConfig(p_config) \ +{\ + (p_config)->readbuffer_size = 0;\ +} + +/*************************************************************************** + * Enum declaration + ***************************************************************************/ +/*EN + * \brief Speaker index of CRI Movie PCM output + * \ingroup MDL_MV_OPTION + */ +/*JP + * \brief CRI Movie のPCM出力のスピーカー配置 + * \ingroup MDL_MV_OPTION + */ +typedef enum { + CRIMV_PCM_BUFFER_L = 0, /*EN< The LEFT channel of CRI Movie output */ + /*JP< CRI Movie オーディオ出力の LEFT チャンネル */ + CRIMV_PCM_BUFFER_R = 1, /*EN< The RIGHT channel of CRI Movie output */ + /*JP< CRI Movie オーディオ出力の RIGHT チャンネル */ + CRIMV_PCM_BUFFER_LS = 2, /*EN< The Surround LEFT channel of CRI Movie output */ + /*JP< CRI Movie オーディオ出力の Surround LEFT チャンネル */ + CRIMV_PCM_BUFFER_RS = 3, /*EN< The Surround RIGHT channel of CRI Movie output */ + /*JP< CRI Movie オーディオ出力の Surround RIGHT チャンネル */ + CRIMV_PCM_BUFFER_C = 4, /*EN< The CENTER channel of CRI Movie output */ + /*JP< CRI Movie オーディオ出力の CENTER チャンネル */ + CRIMV_PCM_BUFFER_LFE = 5, /*EN< The LFE channel of CRI Movie output */ + /*JP< CRI Movie オーディオ出力の LFE チャンネル */ + CRIMV_PCM_BUFFER_EXT1 = 6, /*EN< The EXT1(Rear Left) channel of CRI Movie output */ + /*JP< CRI Movie オーディオ出力の EXT1(Rear Left) チャンネル */ + CRIMV_PCM_BUFFER_EXT2 = 7, /*EN< The EXT2(Rear Right) channel of CRI Movie output */ + /*JP< CRI Movie オーディオ出力の EXT2(Rear Right) チャンネル */ + + /* Keep enum 4bytes */ + CRIMV_PCM_BUFFER_MAKE_ENUM_SINT32 = 0x7FFFFFFF +} CriMvPcmBufferIndex; + + +/*EN + * \brief Composite mode of alpha movie + * \ingroup MDL_MV_OPTION + */ +/*JP + * \brief アルファムービの合成モード + * \ingroup MDL_MV_OPTION + */ +typedef enum { + CRIMV_COMPO_OPAQ = 0, /*EN< Opacity, no alpha value */ + /*JP< 不透明、アルファ情報なし */ + CRIMV_COMPO_ALPHFULL = 1, /*EN< Full alpha blending (8bits-alpha data) */ + /*JP< フルAlpha合成(アルファ用データが8ビット) */ + CRIMV_COMPO_ALPH3STEP = 2, /*EN< 3 Step Alpha */ + /*JP< 3値アルファ */ + CRIMV_COMPO_ALPH32BIT = 3, /*EN< Full alpha blending (32bits color + alpha data) */ + /*JP< フルAlpha、(カラーとアルファデータで32ビット) */ + CRIMV_COMPO_ALPH1BIT = 4, /*EN< Alpha blending (24bits color + 1->8bits alpha) */ + /*JP< フルAlpha、(カラーとアルファデータで32bit、値は2値) */ + CRIMV_COMPO_ALPH2BIT = 5, /*EN< Alpha blending (24bits color + 2->8bits alpha) */ + /*JP< フルAlpha、(カラーとアルファデータで32bit、値は4値) */ + CRIMV_COMPO_ALPH3BIT = 6, /*EN< Alpha blending (24bits color + 3->8bits alpha) */ + /*JP< フルAlpha、(カラーとアルファデータで32bit、値は8値) */ + CRIMV_COMPO_ALPH4BIT = 7, /*EN< Alpha blending (24bits color + 4->8bits alpha) */ + /*JP< フルAlpha、(カラーとアルファデータで32bit、値は16値)*/ + + /* Keep enum 4bytes */ + CRIMV_COMPO_MAKE_ENUM_SINT32 = 0x7FFFFFFF +} CriMvAlphaType; + + +/*EN + * \brief Result of the last video frame retrieval + * \ingroup MDL_MV_OPTION + */ +/*JP + * \brief 前回のビデオフレーム取得の結果 + * \ingroup MDL_MV_OPTION + */ +typedef enum { + CRIMV_LASTFRAME_OK = 0, /*EN< Succeeded */ + /*JP< 取得成功 */ + CRIMV_LASTFRAME_TIME_EARLY = 1, /*EN< Failed. The frame is not yet the time to draw */ + /*JP< 取得失敗。フレーム表示時刻が再生時間に達していなかった */ + CRIMV_LASTFRAME_DECODE_DELAY = 2, /*EN< Failed. The frame to draw is not decoded yet */ + /*JP< 取得失敗。ビデオフレームのデコードが間に合わなかった */ + CRIMV_LASTFRAME_DISCARDED = 3, /*EN< Failed. The video frame is discarded by app */ + /*JP< 取得失敗。アプリによって破棄された */ + //CRIMV_LASTFRAME_NO_INPUT_DATA = 4, //Not supported yet + //CRIMV_LASTFRAME_SKIPPED = 5, //Not supported yet + //CRIMV_LASTFRAME_DEMUX_STUCKED = 6, //Not supported yet + + /* Keep enum 4bytes */ + CRIMV_LASTFRAME_MAKE_ENUM_SINT32 = 0x7FFFFFFF +} CriMvLastFrameResult; + +#if defined(XPT_TGT_PS3PPU) +/*EN + * \brief Graphic Environment type for PS3 + * \ingroup MDL_MV_OPTION + */ +/*JP + * \brief PS3のグラフィック環境 + * \ingroup MDL_MV_OPTION + */ +typedef enum { + CRIMV_GRAPHIC_ENV_GCM = 0, /*EN< GCM. (or same ARGB 32bit texture format of GCM) */ + /*JP< GCM環境 (またはテクスチャフォーマットがGCMと同じ環境) */ + CRIMV_GRAPHIC_ENV_PSGL = 1, /*EN< PSGL. (or same ARGB 32bit texture format of PSGL) */ + /*JP< PSGL環境 (またはテクスチャフォーマットがPSGLと同じ環境) */ + + /* Keep enum 4bytes */ + CRIMV_GRAPHIC_ENV_MAKE_ENUM_SINT32 = 0x7FFFFFFF +} CriMvGraphicEnv; +#endif + + +/* CRI Movie Interanl handle status + * + * The possible legal states of a CriMvPly handle. Over the course of your application + * the CriMvPly handle will walk through the following states in roughly the following + * order. In states that are waiting states, you can request the + * CriMvPly handle to advance to the next state by calling the criMvPly_IncrementState() + * function. You can check the status of a valid CriMvPly handle at any time + * by calling criMvPly_GetStatus(). + * + * It is not possible to jump from a state to an arbitrary other state. Normal play + * proceeds from the CRIMVPLY_STATUS_STOP state through the CRIMV_PLY_STATUS_PLAYEND + * state in that order. Premature termination can be requested with the criMvPly_Stop() + * function. + * + * \sa criMvPly_IncrementState(), criMvPly_GetStatus(), criMvPly_Stop() + */ +typedef enum { + CRIMVPLY_STATUS_STOP = 0, /* Standstill. No processing is occurring. + * CriMvPly handles are created into this state. + */ + /* 停止中 */ + CRIMVPLY_STATUS_DECHDR = 1, /* The CriMvPly structure is now parsing the header + * of the file, including information on height and width + * of the video stream. + */ + /* ヘッダ解析中 */ + CRIMVPLY_STATUS_WAIT_PREP = 2, /* The header has been decoded and criMvPly_GetStreamingParameters() + * will now provide valid values. Typically you will call + * criMvPly_AllocateWorkBuffer() with this information at this point. + */ + /* PREP状態へのIncrementState待ち
+ AllocateWorkBufferしてから次へいくこと */ + CRIMVPLY_STATUS_PREP = 3, /* Transition to this state to acknowledge to the + * CriMvPly handle that you have allocated your work buffers. */ + /* 再生準備中 */ + CRIMVPLY_STATUS_WAIT_PLAYING = 4, /* The audio and video decoders are now ready to begin playback.*/ + /* PLAYING状態へのIncrementState待ち
+ この状態で既にビデオとオーディオのデコード結果は取得できる。*/ + CRIMVPLY_STATUS_PLAYING = 5, /* The decoders are currently decoding and playing output. */ + /* 再生中 */ + CRIMVPLY_STATUS_WAIT_PLAYEND = 6, /* The library is waiting for you to acknowledge the end of the movie. You + * have informed the CriMvPly structure that an end-of-file condition exists, + * but final frames of video and audio may still be pending in your application. */ + /* PLAYEND状態へのIncrementState待ち */ + CRIMVPLY_STATUS_PLAYEND = 7, /* You have acknowledged the end of the movie. Teardown can occur at this point. */ + /* 再生終了 */ + CRIMVPLY_STATUS_STOP_PROCESSING = 8, /* A request to stop has been received by the CriMvPly structure, + * that is, you have called criMvPly_Stop(), and a stop is now pending. */ + /* 停止処理中 */ + CRIMVPLY_STATUS_WAIT_STOP = 9, /* The CriMvPly handle has acknowledged the stop request and + * you may now call criMvPly_IncrementState() to transition to + * the CRIMVPLY_STATUS_STOP state. */ + /* STOP状態へのIncrementState待ち */ + CRIMVPLY_STATUS_ERROR = 10, /* An error has occurred. */ + /* エラー */ + + /* Keep enum 4bytes */ + CRIMVPLY_STATUS_MAKE_ENUM_SINT32 = 0x7FFFFFFF +} CriMvPlyStatus; + + +/* Sofdec2 */ +typedef enum { + CRIMVPLY_META_FLAG_OFF = 0x0000, + CRIMVPLY_META_FLAG_CUE = 0x0001, + CRIMVPLY_META_FLAG_SEEK = 0x0002, + CRIMVPLY_META_FLAG_ALL = CRIMVPLY_META_FLAG_CUE + CRIMVPLY_META_FLAG_SEEK, + + /* Keep enum 4bytes */ + CRIMVPLY_META_FLAG_MAKE_ENUM_SINT32 = 0x7FFFFFFF +} CriMvMetaFlag; + +/* Color Conversion*/ +typedef enum{ + CRIMV_COLORSPACE_CONVERSION_TYPE_ITU_R_BT601_LIMITED = 0, + CRIMV_COLORSPACE_CONVERSION_TYPE_ITU_R_BT601_FULLRANGE = 1, + + /* Keep enum 4bytes */ + CRIMV_COLORSPACE_CONVERSION_TYPE_ENUM_SINT32 = 0x7FFFFFFF +}CriMvColorSpaceConversionType; + +typedef void *(*CriMvMetaDataWorkMallocFunc)(void *obj, CriUint32 size); +typedef void (*CriMvMetaDataWorkFreeFunc)(void *obj, void *mem); + +/* OUTER_FRAMEPOOL_WORK */ +#define CriMvFramepoolWorkMallocFunc CriMvMetaDataWorkMallocFunc +#define CriMvFramepoolWorkFreeFunc CriMvMetaDataWorkFreeFunc + +/*************************************************************************** + * Data type declaration + ***************************************************************************/ + +/*EN + * \brief Audio parameters + * \ingroup MDL_MV_INFO + * + * \sa CriMvStreamingParameters, CriMvWaveInfo + */ +/*JP + * \brief オーディオパラメータ + * \ingroup MDL_MV_INFO + * + * オーディオストリームのパラメータ + * \sa CriMvStreamingParameters, CriMvWaveInfo + */ +typedef struct { + CriUint32 sampling_rate; /*EN< Sampling rate */ + /*JP< サンプリング周波数 */ + CriUint32 num_channel; /*EN< Number of channels. Monaural = 1, Stereo = 2 */ + /*JP< オーディオチャネル数 */ + CriUint32 total_samples; /*EN< Total number of samples */ + /*JP< 総サンプル数 */ + CriUint32 output_buffer_samples; /*EN< Output wave buffer size */ + /*JP< サウンド出力バッファのサンプル数 */ + CriUint32 codec_type; /*EN< Codec type */ + /*JP< コーデック種別 */ + +} CriMvAudioParameters; + +/*EN + * \brief Video Parameters + * \ingroup MDL_MV_INFO + * \sa CriMvStreamingParameters + */ +/*JP + * \brief ビデオパラメータ + * \ingroup MDL_MV_INFO + * ビデオストリームのパラメータ + * \sa CriMvStreamingParameters + */ +typedef struct { + CriUint32 max_width; /*EN< Maximum video width for stream. (multiple of 8) */ + /*JP< ムービ最大幅(8の倍数) */ + CriUint32 max_height; /*EN< Maximum video height for stream. (multiple of 8)*/ + /*JP< ムービ最大高さ(8の倍数) */ + CriUint32 disp_width; /*EN< Width of the image to draw. */ + /*JP< 表示したい映像の横ピクセル数(左端から) */ + CriUint32 disp_height; /*EN< Height of the image to draw. */ + /*JP< 表示したい映像の縦ピクセル数(上端から) */ + CriUint32 num_frame_pool; /*EN< Number of frame pools required for stream */ + /*JP< フレームプール数 */ + CriUint32 framerate; /*EN< Frame rate per second [x1000]. */ + /*JP< フレームレート[x1000] */ + CriUint32 framerate_n; /*EN< Frame rate (in rational as numerator). framerate_n/framerate_d = framerate */ /* UTODO: 変数名 */ + /*JP< フレームレートの分子(有理数形式)。framerate_n/framerate_d = framerate */ + CriUint32 framerate_d; /*EN< Frame rate (in rational as denominator). */ + /*JP< フレームレートの分母(有理数形式)。 */ + CriUint32 total_frames; /*EN< Total number of video frames */ + /*JP< 総フレーム数 */ + + CriUint32 material_width; /*EN< Width of the video source resolustion before encoding. */ + /*JP< エンコード前のビデオ素材の横ピクセル数 */ + CriUint32 material_height; /*EN< Height of the video source resolustion before encoding. */ + /*JP< エンコード前のビデオ素材の縦ピクセル数 */ + CriUint32 screen_width; /*EN< Screen width set by encoding and cropping. + * This parameter is only available when you encoded the movie with "Widescreen TV Support" option. + * Normally this value is 0. */ + /*JP< エンコード時に指定したスクリーン幅。 + * この値はエンコード時に「ワイドテレビ支援機能」を使用した場合のみ有効になります。 + * 通常は0です。 */ + + CriUint32 codec_type; /*EN< Video Codec Type. If you encoded the movie for PS2, this value is 2. + * Normally this value is 1 or 0(no info). + * If the codec_type is 1, the CRI Movie for ONLY PS2 can play the movie file. */ + /*JP< ビデオコーデック種別。PS2用にエンコードした場合 2になります。 + * 通常は 1または 0(情報無し)です。 + * コーデック種別が2のムービは、PS2版ライブラリで「のみ」再生可能です。 */ + CriUint32 codec_dc_option; /*EN< Video Codec DC Option. If you encoded the movie for PS2, this value is 10. + * Normally this value is 11 or 0(no info). + * If the codec_type is 11, the CRI Movie for PS2 can NOT play the movie file. */ + /*JP< ビデオコーデックのDCオプション種別。PS2用にエンコードした場合10になります。 + * 通常は11または 0(情報無し)です。 + * コーデックDCオプションが11のムービは、PS2版ライブラリ「では」再生できません。 */ + CriUint32 color_conversion_type; /*EN< Color space converion type. Fullrange or Limited.*/ + /*JP< 色変換タイプ。 */ + CriSint32 capacity_of_picsize; /*EN< Capacity size of video pictures. */ + /*JP< ピクチャサイズ上限値 */ + CriUint32 average_bitrate; /*EN< Average bitrate. */ + /*JP< 平均ビットレート */ +} CriMvVideoParameters; + +/*EN + * \brief Alpha Parameters + * \ingroup MDL_MV_INFO + * \sa CriMvStreamingParameters + */ +/*JP + * \brief アルファパラメータ + * \ingroup MDL_MV_INFO + * アルファストリームのパラメータ + * \sa CriMvStreamingParameters + */ +typedef struct { + CriUint32 max_width; /*EN< Maximum alpha width for stream */ + /*JP< アルファフレームの最大幅 */ + CriUint32 max_height; /*EN< Maximum alpha height for stream */ + /*JP< アルファフレームの最大高さ */ + CriUint32 disp_width; /*EN< valid alpha width */ + /*JP< アルファフレームの実有効幅 */ + CriUint32 disp_height; /*EN< valid alpha height */ + /*JP< アルファフレームの実有効高さ */ + CriUint32 framerate; /*EN< Frame rate per second [x1000]. */ + /*JP< アルファのフレームレート[x1000] */ + CriUint32 framerate_n; /*EN< Frame rate (in rational as numerator). framerate_n/framerate_d = framerate */ /* UTODO: 変数名 */ + /*JP< フレームレートの分子(有理数形式)。framerate_n/framerate_d = framerate */ + CriUint32 framerate_d; /*EN< Frame rate (in rational as denominator). */ + /*JP< フレームレートの分母(有理数形式)。 */ + CriUint32 total_frames; /*EN< Total number of alpha frames */ + /*JP< 総フレーム数 */ + CriMvAlphaType alpha_type; /*EN< Alpha Composite Type. */ + /*JP< アルファ合成種別。 */ + CriUint32 codec_type; /*EN< Internal use only. Do not access this */ + /*JP< ライブラリ内部使用変数 */ + CriUint32 color_conversion_type; /*EN< Color space converion type. Fullrange or Limited.*/ + /*JP< 色変換タイプ。 */ + CriSint32 capacity_of_picsize; /*EN< Capacity size of video pictures. */ + /*JP< ピクチャサイズ上限値 */ + CriUint32 average_bitrate; /*EN< Average bitrate. */ + /*JP< 平均ビットレート */ +} CriMvAlphaParameters; + + +/*EN + * \brief Streaming Parameters + * \ingroup MDL_MV_INFO + * This structure includes streaming parameters and playing parameters. + * \sa CriMvEasyPlayer::GetMovieInfo() + */ +/*JP + * \brief ストリーミング再生パラメータ + * \ingroup MDL_MV_INFO + * ストリーミング再生パラメータ。
+ * ストリーム自体の情報と、再生のために必要なパラメータの両方を含んでいる。 + * \sa CriMvEasyPlayer::GetMovieInfo() + */ +typedef struct { + /* Stream */ + CriUint32 is_playable; /*EN< Flag of the movie file is playable or not. 1 is playable. 0 is not playable.*/ + /*JP< 再生可能フラグ(1: 再生可能、0: 再生不可) */ + CriFloat32 buffering_time; /*EN< Amount of time to buffer in the stream, in seconds */ + /*JP< 読み込みデータのバッファリング時間。単位[sec]。 */ + CriUint32 max_bitrate; /*EN< Maximum bits per second for stream. This value includes video and audio both. */ + /*JP< 最大ビットレート(絵と音の合計) */ + CriUint32 max_chunk_size; /*EN< Maximum chunk size of incoming stream (USF) file */ + /*JP< 最大USFチャンクサイズ */ + CriUint32 min_buffer_size; /*EN< Minimum buffer size for reading */ + /*JP< 最低限必要な読み込みバッファサイズ。
オーディオとビデオの合計 */ + CriSint32 read_buffer_size; /*EN< Input buffer size for reading data */ + /*JP< リードバッファサイズ */ + /* Video */ + CriUint32 num_video; /*EN< Number of simultaneous video streams */ + /*JP< ビデオデコーダの数。現在は1固定。*/ + CriMvVideoParameters video_prm[CRIMV_MAX_VIDEO_NUM]; /*EN< Video parameters see CriMvVideoParameters struct for details */ + /*JP< ビデオパラメータ */ + /* Audio */ + CriUint32 num_audio; /*EN< Number of simultaneous audio streams */ + /*JP< オーディオデコーダの数。現在は1固定。*/ + CriSint32 track_play_audio; /*EN< Track of audio playback. */ + /*JP< 再生するオーディオチャネル番号。-1指定で再生無し。 */ + CriMvAudioParameters audio_prm[CRIMV_MAX_AUDIO_NUM]; /*EN< Audio parameters see CriMvAudioParameters struct for details */ + /*JP< オーディオパラメータ */ + /* Subtitle */ + CriUint32 num_subtitle; /*EN< Number of subtitles */ + /*JP< 字幕チャネル数 */ + CriSint32 channel_play_subtitle; /*EN< Channel for playing subtitles */ + /*JP< 再生する字幕チャネル番号 */ + CriUint32 max_subtitle_size; /*EN< Maximum size of subtitle data */ + /*JP< 字幕データの最大サイズ*/ + + /* Composite mode */ + CriUint32 num_alpha; /*EN< Number of alpha channels (current spec allows only one) */ + /*JP< アルファデコーダの数。現在は1固定。 */ + CriMvAlphaParameters alpha_prm[CRIMV_MAX_ALPHA_NUM]; /*EN< Alpha parameters see CriMvAlphaParameters struct for details */ + /*JP< アルファパラメータ */ + + CriBool seekinfo_flag; /*EN< Flag of the movie file inclues seek info */ + /*JP< シーク情報フラグ */ + CriUint32 format_ver; /*EN< Format version */ + /*JP< フォーマットバージョン */ +} CriMvStreamingParameters; + + +/*EN + * \brief Input Buffer Information + * \ingroup MDL_MV_INFO + * \sa CriMvEasyPlayer::GetInputBufferInfo(), + * CriMvEasyPlayer::SetReloadThresholdTime(), CriMvEasyPlayer::SetBufferingTime() + */ +/*JP + * \brief 入力バッファ情報 + * \ingroup MDL_MV_INFO + * \sa CriMvEasyPlayer::GetInputBufferInfo(), + * CriMvEasyPlayer::SetReloadThresholdTime(), CriMvEasyPlayer::SetBufferingTime() + */ +typedef struct { + CriUint32 buffer_size; /*EN< Input buffer size [byte] */ + /*JP< 入力バッファサイズ[byte] */ + CriUint32 data_size; /*EN< Data size in input buffer[byte] */ + /*JP< 入力バッファにあるデータサイズ[byte] */ + CriUint32 reload_threshold; /*EN< Re-load threshold. When data size is less than re-load threshold, next read is requested. */ + /*JP< 再読み込み閾値[byte]。データサイズがこの値以下になると読み込みを行います。 */ +} CriMvInputBufferInfo; + + +// TEMP: for internal use +typedef struct { + CriUint8 *imageptr; + CriUint32 bufsize; // [Byte] + CriUint32 line_pitch; // [Byte] + CriUint32 line_size; // [Byte] + CriUint32 num_lines; +} CriMvImageBufferInfo; + +/*EN + * \brief Video Frame Information + * \ingroup MDL_MV_INFO + * \sa CriMvEasyPlayer::GetFrameOnTimeAs32bitARGB(), CriMvEasyPlayer::GetFrameOnTimeAsYUVBuffers, + * CriMvEasyPlayer::GetFrameOnTimeAsYUV422(), CriMvEasyPlayer::DiscardNextFrame() + */ +/*JP + * \brief ビデオフレーム情報 + * \ingroup MDL_MV_INFO + * ビデオフレーム情報 + * \sa CriMvEasyPlayer::GetFrameOnTimeAs32bitARGB(), CriMvEasyPlayer::GetFrameOnTimeAsYUVBuffers, + * CriMvEasyPlayer::GetFrameOnTimeAsYUV422(), CriMvEasyPlayer::DiscardNextFrame() + */ +typedef struct { + CriUint8 *imageptr; /*EN< Pointer to image data */ + /*JP< 画像データのポインタ */ + CriSint32 frame_id; /*EN< Frame ID ot the playback */ + /*JP< フレーム識別ID(ループ/連結再生時は通算) */ + CriUint32 width; /*EN< Width of movie frame [pixel] (multiple of 8) */ + /*JP< ムービの横幅[pixel] (8の倍数) */ + CriUint32 height; /*EN< Height of movie frame [pixel] (multiple of 8) */ + /*JP< ムービの高さ[pixel] (8の倍数) */ + CriUint32 pitch; /*EN< Pitch of movie frame [byte]*/ + /*JP< ムービのピッチ[byte] */ + CriUint32 disp_width; /*EN< Width of the image to draw. */ + /*JP< 表示したい映像の横ピクセル数(左端から) */ + CriUint32 disp_height; /*EN< Height of the image to draw. */ + /*JP< 表示したい映像の縦ピクセル数(上端から) */ + CriUint32 framerate; /*EN< Frames per second times 1000 */ + /*JP< フレームレートの1000倍の値 */ + CriUint32 framerate_n; /*EN< Frame rate (in rational as numerator). framerate_n/framerate_d = framerate */ /* UTODO: 変数名 */ + /*JP< フレームレートの分子(有理数形式)。framerate_n/framerate_d = framerate */ + CriUint32 framerate_d; /*EN< Frame rate (in rational as denominator). */ + /*JP< フレームレートの分母(有理数形式)。 */ + CriUint64 time; /*EN< Frame time ('time / tunit' indicates time in seconds) */ + /*JP< 時刻。time / tunit で秒を表す。 */ + CriUint64 tunit; /*EN< Unit of time measurement */ + /*JP< 時刻単位 */ + CriUint32 cnt_concatenated_movie; /*EN< Number of concatenated movie data */ + /*JP< ムービの連結回数 */ + CriSint32 frame_id_per_data; /*EN< Frame ID of the movie data */ + /*JP< ムービデータごとのフレーム番号 */ + + CriBool csc_flag; /*EN< This is temporary variable. Please don't access. */ + /*JP< テスト中の変数です。アクセスしないでください。 */ + + CriMvAlphaType alpha_type; /*EN< Composite mode */ + /*JP< アルファの合成モード*/ + + void *details_ptr[CRIMV_FRAME_DETAILS_NUM]; // for internal use + + CriSint32 num_images; // TEMP: for internal use + CriMvImageBufferInfo image_info[4]; // TEMP: for internal use + + CriUint32 color_conversion_type; /*EN< Color space converion type. Fullrange or Limited.*/ + /*JP< 色変換タイプ。 */ + CriUint32 total_frames_per_data; /*EN< Total frames of the movie data*/ + /*JP< ムービデータ単位の総フレーム数 */ + CriUint32 cnt_skipped_frames; /*EN< Number of skipped frames to decode */ + /*JP< デコードスキップされたフレーム数 */ +} CriMvFrameInfo; + +/*EN + * \brief Subtitle Information + * \ingroup MDL_MV_INFO + * \sa CriMvEasyPlayer::GetSubtitleOnTime() + */ +/*JP + * \brief 字幕情報 + * \ingroup MDL_MV_INFO + * \sa CriMvEasyPlayer::GetSubtitleOnTime() + */ +typedef struct { + CriUint8 *dataptr; /*EN< Pointer to subtitle data */ + /*JP< 字幕データのポインタ */ + CriUint32 data_size; /*EN< Size of subtitle data */ + /*JP< 字幕データサイズ */ + CriSint32 channel_no; /*EN< Channel number of subtitle data */ + /*JP< 字幕データのチャネル番号 */ + CriUint64 time_unit; /*EN< Unit of time measurement */ + /*JP< 時刻単位 */ + CriUint64 in_time; /*EN< Display start time */ + /*JP< 表示開始時刻*/ + CriUint64 duration_time; /*EN< Display duration time */ + /*JP< 表示持続時間 */ + CriUint32 cnt_concatenated_movie; /*EN< Number of concatenated movie data */ + /*JP< ムービの連結回数 */ + CriUint64 in_time_per_data; /*EN< Display start time per movie data*/ + /*JP< ムービデータごとに表示開始時刻*/ +} CriMvSubtitleInfo; + +/*EN + * \brief Event Point Info + * \ingroup MDL_MV_INFO + * Event point info is the each timing info was embeded to movie data as cue point info. + * \sa CriMvEasyPlayer::GetCuePointInfo() + */ +/*JP + * \brief イベントポイント情報 + * \ingroup MDL_MV_INFO + * キューポイント機能でムービデータに埋め込まれた個々のタイミング情報です。 + * \sa CriMvEasyPlayer::GetCuePointInfo() + */ +typedef struct { + CriChar8 *cue_name; /*EN< The name string of event point. Char code depends on cue point text. */ + /*JP< イベントポイント名。文字コードはキューポイント情報テキストに従います。 */ + CriUint32 size_name; /*EN< The data size of name string */ + /*JP< イベントポイント名のデータサイズ */ + CriUint64 time; /*EN< Timer counter */ + /*JP< タイマカウント */ + CriUint64 tunit; /*EN< Counter per 1 second. "count / unit" indicates the timer on the second time scale. */ + /*JP< 1秒あたりのタイマカウント値。count ÷ unit で秒単位の時刻となります。 */ + CriSint32 type; /*EN< Event point type */ + /*JP< イベントポイント種別 */ + CriChar8 *param_string; /*EN< The string of user parameters. Char code depends on cue point text. */ + /*JP< ユーザパラメータ文字列。文字コードはキューポイント情報テキストに従います。 */ + CriUint32 size_param; /*EN< The data size of user parameters string */ + /*JP< ユーザパラメータ文字列のデータサイズ */ + CriUint32 cnt_callback; /*EN< The counter of calling cue point callback. */ + /*JP< キューポイントコールバックの呼び出しカウンタ */ +} CriMvEventPoint; + +/*EN + * \brief Cue Point Info + * \ingroup MDL_MV_INFO + * Cue point info includes the number of event points and the list. + * \sa CriMvEasyPlayer::GetCuePointInfo() + */ +/*JP + * \brief キューポイント情報 + * \ingroup MDL_MV_INFO + * キューポイント情報は、イベントポイントの個数と一覧です。
+ * \sa CriMvEasyPlayer::GetCuePointInfo() + */ +typedef struct { + CriUint32 num_eventpoint; /*EN< The number of event points */ + /*JP< イベントポイント個数 */ + CriMvEventPoint *eventtable; /*EN< The list of event points */ + /*JP< イベントポイント一覧 */ +} CriMvCuePointInfo; + +/*EN + * \brief YUV Texture Buffer Parameters + * \ingroup MDL_MV_INFO + * The output buffer parameters for CriMvEasyPlayer::GetFrameOnTimeAsYUVBuffers(). + * CriMvEasyPlayer::GetFrameOnTimeAsYUVBuffers() outputs data for pixel shader.
+ * If an application doesn't play alpha movie, CRI Movie library doesn't use alpha buffer parameters.
+ * \sa CriMvEasyPlayer::GetFrameOnTimeAsYUVBuffers() + */ +/*JP + * \brief YUV個別バッファ情報 + * \ingroup MDL_MV_INFO + * CriMvEasyPlayer::GetFrameOnTimeAsYUVBuffers() の出力バッファ情報です。
+ * CriMvEasyPlayer::GetFrameOnTimeAsYUVBuffers() はPixel Shader 向けのデコード結果を出力します。
+ * アルファムービ再生を行わない場合(不透明の通常再生)は、Alphaテクスチャ関連のパラメータは使用しません。
+ * \sa CriMvEasyPlayer::GetFrameOnTimeAsYUVBuffers() + */ +typedef struct { + CriUint8 *y_imagebuf; /*EN< Pointer to the buffer of Y texture */ + /*JP< Yテクスチャのバッファポインタ */ + CriUint32 y_bufsize; /*EN< Size of the buffer of Y texture [byte] */ + /*JP< Yテクスチャのバッファサイズ[byte] */ + CriUint32 y_pitch; /*EN< Pitch of the buffer of Y texture [byte] */ + /*JP< Yテクスチャのピッチ[byte] */ + CriUint8 *u_imagebuf; /*EN< Pointer to the buffer of U texture */ + /*JP< Uテクスチャのバッファポインタ */ + CriUint32 u_bufsize; /*EN< Size of the buffer of U texture [byte] */ + /*JP< Uテクスチャのバッファサイズ[byte] */ + CriUint32 u_pitch; /*EN< Pitch of the buffer of U texture [byte] */ + /*JP< Uテクスチャのピッチ[byte] */ + CriUint8 *v_imagebuf; /*EN< Pointer to the buffer of V texture */ + /*JP< Vテクスチャのバッファポインタ */ + CriUint32 v_bufsize; /*EN< Size of the buffer of V texture [byte] */ + /*JP< Vテクスチャのバッファサイズ[byte] */ + CriUint32 v_pitch; /*EN< Pitch of the buffer of V texture [byte] */ + /*JP< Vテクスチャのピッチ[byte] */ + CriUint8 *a_imagebuf; /*EN< Pointer to the buffer of Alpha texture */ + /*JP< Alphaテクスチャのバッファポインタ */ + CriUint32 a_bufsize; /*EN< Size of the buffer of Alpha texture [byte] */ + /*JP< Alphaテクスチャのバッファサイズ[byte] */ + CriUint32 a_pitch; /*EN< Pitch of the buffer of Alpha texture [byte] */ + /*JP< Alphaテクスチャのピッチ[byte] */ +} CriMvYuvBuffers; + + +/*EN + * \brief Playback Information + * \ingroup MDL_MV_INFO + * The output playback information of CriMvEasyPlayer::GetPlaybackInfo(). + * These parameters represents current movie playback information such as decode delay of movie data and + * interval of video frames retrieval. + * \sa CriMvEasyPlayer::GetPlaybackInfo() + */ +/*JP + * \brief 再生情報 + * \ingroup MDL_MV_INFO + * CriMvEasyPlayer::GetPlaybackInfo() の出力再生情報です。
+ * フレームの取得間隔やデコードの遅延などの現在再生しているムービの再生情報を表します。
+ * \sa CriMvEasyPlayer::GetPlaybackInfo() + */ +typedef struct { + CriUint64 cnt_app_loop; /*EN< Loop count of application. Precisely, this is a number of calls of CriMvEasyPlayer::Update(). The count up will start after app is able to acquire the first video frame */ + /*JP< アプリケーションのループカウント。具体的には CriMvEasyPlayer::Update() の呼び出し回数になります。最初のフレームが取得可能になるとカウントが始まります。*/ + CriUint64 cnt_frame_interval[4]; /*EN< Interval of video frames retrieval. These values are count up when CriMvEasyPlayer::IsNextFrameOnTime() returns TRUE. + * + * The interval of video frames retrieval indicates a number of the loop count when your application calls CriMvEasyPlayer::IsNextFrameOnTime() in the main loop. + * In case that the application waits for vertical retrace, 1 interval equals about 16.7 msec. + * The index of array represents the count of intervals as follows: + * + *
Index Interval of video frames retrieval + *
0 Every main loop + *
1 2 main loops + *
2 3 main loops + *
3 4 or more main loops + *
+ * With these values, you can check if the application gets video frames with appropriate intervals. Please use the values as measuring playback smoothness + * + * In order to use these values, the application must meet the following conditions: + * - The main loop should work periodically and stably (Ideally sync with vertical retrace) + * - The application should call CriMvEasyPlayer::IsNextFrameOnTime() once in everly main loop + * + * For example, if the application runs at 59.94fps by waiting for vertical retrace and a framerate of playing movie file is 29.97fps, + * only cnt_frame_interval[1] should be increased. + */ + /*JP< フレームの取得間隔。これらの値は、 CriMvEasyPlayer::IsNextFrameOnTime() がTRUEを返した時にカウントアップされます。
+ * + * フレームの取得間隔とは、アプリケーションがメインループ内でフレーム取得関数を読んだ時のループの回数を意味します。 + * メインループがVSyncと同期している場合は、1 Interval = 約16.7msecということになります。 + * 配列のインデックスは、以下のように取得間隔を表します。
+ * + *
インデックス フレームの取得間隔 + *
0 毎メインループ + *
1 2 メインループ + *
2 3 メインループ + *
3 4 メインループ以上 + *
+ * これらの値を見ることで、アプリが正しい間隔でフレームを取得できたのかどうかをチェックすることができます。ムービが滑らかに再生できているかの目安にしてください。
+ * + * ただし前提として、以下の条件をアプリが満たしている必要があります。 + * - アプリがVSyncなど、一定の周期で安定して動作している + * - メインループ内で毎回 CriMvEasyPlayer::IsNextFrameOnTime() を呼び出す + * + * 上記の条件下において、例えばアプリが59.94fpsで動作している状態で、フレームレートが29.97fpsのムービを再生した場合、cnt_frame_interval[1]のみが増え続けれれば + * 正しい間隔でフレームの取得が出来たことになります。 + */ + CriUint64 cnt_time_early; /*EN< A count of how many times CriMvEasyPlayer::IsNextFrameOnTime() returns FALSE due to the determination if it is the time to provide the next video frame */ + /*JP< CriMvEasyPlayer::IsNextFrameOnTime() が、フレーム表示時刻判定によりFALSEを返した回数。*/ + CriUint64 cnt_decode_delay; /*EN< A count of how many times CriMvEasyPlayer::IsNextFrameOnTime() returns FALSE due to the delay of decoding movie data */ + /*JP< CriMvEasyPlayer::IsNextFrameOnTime()が、ビデオフレームのデコード遅延によりFALSEを返した回数 */ + CriFloat32 time_max_delay; /*EN< Maximum delay time [msec] of the actual time a video frame retrieved against the original time should be retrieved */ + /*JP< ビデオフレームを取得した実際の時刻と、本来表示すべき時刻との最大遅延時間 [msec]。 */ + CriFloat32 time_average_delay; /*EN< Average delay time [msec] of the actual time a video frame retrieved against the original time should be retrieved */ + /*JP< ビデオフレームを取得した実際の時刻と、本来表示すべき時刻との平均遅延時間 [msec]。 */ +} CriMvPlaybackInfo; + +#if defined(XPT_TGT_PS3PPU) +/*EN + * \brief Parameters of SPURS and PPU for decoding + * \ingroup MDL_MV_BASIC + * + * \sa CriMv::SetupSpursParameters_PS3(), CriMv::CalcSpursWorkSize_PS3() + */ +/*JP + * \brief デコードに使うSPURSおよびPPUのパラメータ + * \ingroup MDL_MV_BASIC + * + * \sa CriMv::SetupSpursParameters_PS3(), CriMv::CalcSpursWorkSize_PS3() + */ +typedef struct { + void *spurs_handler; /*EN< SPURS handler */ + /*JP< SPURSハンドル */ + void *spurs_work; /*EN< SPURS work area. The size is spurs_worksize. The alignment is 128 byte. */ + /*JP< SPURS用ワークバッファ。バッファサイズは spurs_worksize で128バイト境界。 */ + CriSint32 spurs_worksize; /*EN< SPURS work size. This size is calculated by CriMv::CalcSpursWorkSize_PS3 function. */ + /*JP< SPURS用ワークサイズ。CriMv::CalcSpursWorkSize_PS3 関数で取得した値。 */ + CriSint32 spurs_max_contention; /*EN< SPURS max contention */ + /*JP< SPURS でムービデコード用に使うSPUの最大数 */ + CriUint8 *spurs_task_priority; /*EN< SPURS task priority x 8 */ + /*JP< SPURS のタスクプライオリティ配列。配列要素は8個。 */ + + CriUint32 ppu_num; /*EN< The number of PPU for decoding (0-2) */ + /*JP< The number of PPU for decoding (0-2) */ + CriSint32 ppu_thread_prio; /*EN< PPU Thread Priority. This priority is used for decoding thread in the case of ppu_num equal 2. */ + /*JP< PPU Thread Priority. この値は ppu_num に2を指定した場合に作成するスレッドに使われる。 */ +} CriMvProcessorParameters_PS3; + +// [NOT SUPPORT on normal library] +// for SPU Thread +typedef struct { + CriUint32 ppu_num; /* The number of PPU for decoding (0-2) */ + CriSint32 ppu_prio; /* PPU Thread Priority */ + CriUint32 spu_num; /* The number of SPU for decoding (0-6) */ + CriSint32 spu_grp_prio; /* SPU Thread Group Priority */ +} CriMvSpuThreadParameters_PS3; + +#endif + +#if defined(XPT_TGT_XBOX360) +/*EN + * \brief Parameters of Xbox360 processors for decoding + * \ingroup MDL_MV_BASIC + * + * \sa CriMvEasyPlayer::SetUsableProcessors_XBOX360() + */ +/*JP + * \brief デコードに使うXbox360プロセッサのパラメータ + * \ingroup MDL_MV_BASIC + * + * \sa CriMvEasyPlayer::SetUsableProcessors_XBOX360() + */ +typedef struct { + CriBool processor0_flag; /*EN< Processor 0 (Core 0, Thread 0) usable flag */ + /*JP< プロセッサ0 (コア0スレッド0) 使用可能フラグ */ + CriBool processor1_flag; /*EN< Processor 1 (Core 0, Thread 1) usable flag */ + /*JP< プロセッサ1 (コア0スレッド1) 使用可能フラグ */ + CriBool processor2_flag; /*EN< Processor 2 (Core 1, Thread 0) usable flag */ + /*JP< プロセッサ2 (コア1スレッド0) 使用可能フラグ */ + CriBool processor3_flag; /*EN< Processor 3 (Core 1, Thread 1) usable flag */ + /*JP< プロセッサ3 (コア1スレッド1) 使用可能フラグ */ + CriBool processor4_flag; /*EN< Processor 4 (Core 2, Thread 0) usable flag */ + /*JP< プロセッサ4 (コア2スレッド0) 使用可能フラグ */ + CriBool processor5_flag; /*EN< Processor 5 (Core 2, Thread 1) usable flag */ + /*JP< プロセッサ5 (コア2スレッド1) 使用可能フラグ */ + CriSint32 thread_priority; /*EN< Priority of decoding threads on the active processors */ + /*JP< 各プロセッサ上でデコード処理を行うスレッドの優先度 */ +} CriMvProcessorParameters_XBOX360; +#endif + +#if defined(XPT_TGT_VITA) +/*EN + * \brief AVC Decoder Parameters + * \ingroup MDL_MV_BASIC + * + * \sa CriMv::SetupAvcDecoderParameters_VITA() + */ +/*JP + * \brief AVCデコーダパラメータ + * \ingroup MDL_MV_BASIC + * + * \sa CriMv::SetupAvcDecoderParameters_VITA() + */ +typedef struct { + CriUint32 horizontal; /*EN< Maximum width for decoding (in pixel) */ + /*JP< 最大デコード画像の横幅 (単位:ピクセル) */ + CriUint32 vertical; /*EN< Maximum height for decoding (in pixel) */ + /*JP< 最大デコード画像の高さ (単位:ピクセル) */ + CriUint32 n_ref_frames; /*EN< Maximum reference frames on decoding (default:3) */ + /*JP< デコード時の最大参照画像の枚数 */ + CriUint32 n_decoders; /*EN< Maximum number of avc decoders (max:1) */ + /*JP< 同時に使用するAVCでコーダの最大数 (1固定) */ + +} CriMvAvcDecoderParameters_VITA; +#endif + +/*--------------------------------------------------------------------------*/ +/* */ +/*--------------------------------------------------------------------------*/ +typedef enum { + CRIMV_PCM_FORMAT_SINT16 = 0, + CRIMV_PCM_FORMAT_FLOAT32 = 1, + + /* Keep enum 4bytes */ + CRIMV_PCM_FORMAT__MAKE_ENUM_SINT32 = 0x7FFFFFFF +} CriMvPcmFormat; +/* + * \brief 16bit wave data information + * \ingroup MDL_MV_INFO + * Information about a 16-bit waveform. + */ +/* 16bit Waveform 情報 */ +typedef struct { + CriUint32 num_channel; /* Number of Channels. monaural = 1, stereo = 2 */ + /* Number of Channels. monaural = 1, stereo = 2 */ + CriUint32 num_samples; /* Number of sample */ + /* サンプル数 */ + CriUint32 sampling_rate; /* Sampling rate */ + /* サンプリング周波数 */ +} CriMvWaveInfo; + +/* オーディオヘッダ */ +typedef struct { + /* ストリーミングパラメータと共通 */ + CriUint32 sampling_rate; + CriUint32 num_channel; + CriUint32 total_samples; + CriUint32 codec_type; + + CriUint32 metadata_count; + CriUint32 metadata_size; + + /* ヘッダ固有 */ + CriUint32 a_input_xsize; +} CriMvPlyAudioHeader; + +/* ビデオヘッダ */ +typedef struct { + /* ヘッダ固有 */ + CriUint32 width; + CriUint32 height; + CriUint32 disp_width; + CriUint32 disp_height; + CriUint32 framerate_n; + CriUint32 framerate_d; + CriUint32 total_frames; + + CriUint32 material_width; /* width of video original source. 0 means no info. */ + CriUint32 material_height; /* height of video original source. 0 means no info. */ + CriUint32 screen_width; /* screen width for Wii */ + + CriUint32 codec_type; + CriUint32 codec_dc_option; /* 11 or 10 */ + + CriUint32 metadata_count; + CriUint32 metadata_size; + + CriUint32 pre_padding; + CriUint32 color_conversion_type; + CriSint32 max_picture_size; + CriSint32 average_bitrate; +} CriMvPlyVideoHeader; + +/* サブタイトルヘッダ */ +typedef struct { + CriBool is_subtitle_data; + CriUint32 num_channel; + CriUint64 time_unit; + CriUint32 max_subtitle_size; +} CriMvPlySubtitleHeader; + +/* キューポイントヘッダ */ +typedef struct { + CriBool is_cuepoint_data; + CriUint32 metadata_count; + CriUint32 metadata_size; + CriUint32 num_eventpoint; + CriUint64 time_unit; +} CriMvPlyCuePointHeader; + +/* アルファヘッダ */ +typedef struct { + /* ヘッダ固有 */ + CriUint32 width; + CriUint32 height; + CriUint32 disp_width; + CriUint32 disp_height; + CriUint32 framerate_n; + CriUint32 framerate_d; + CriUint32 total_frames; + + CriMvAlphaType alpha_type; + CriUint32 codec_type; + + CriUint32 metadata_count; + CriUint32 metadata_size; + + CriUint32 pre_padding; + CriUint32 color_conversion_type; + CriSint32 max_picture_size; + CriSint32 average_bitrate; +} CriMvPlyAlphaHeader; + +/* アルファのみのフレーム情報 */ +typedef struct { + CriUint8 *imageptr; /*EN< Pointer to image data */ + /*JP< 画像データのポインタ */ + CriSint32 frame_id; /*EN< Frame ID */ + /*JP< フレーム識別ID */ + CriUint32 width; /*EN< Width of movie frame [pixel] */ + /*JP< ムービの横幅[pixel] */ + CriUint32 height; /*EN< Height of movie frame [pixel] */ + /*JP< ムービの高さ[pixel] */ + CriUint32 disp_width; /*EN< Width of image [pixel] */ + /*JP< 有効な映像の横幅[pixel] */ + CriUint32 disp_height; /*EN< Height of image [pixel] */ + /*JP< 有効な映像の高さ[pixel] */ + CriUint32 pitch; /*EN< Pitch of movie frame [byte]*/ + /*JP< ムービのピッチ[byte] */ + CriUint64 time; /*EN< Frame time ('time / tunit' indicates time in seconds) */ + /*JP< 時刻。time / tunit で秒を表す。 */ + CriUint64 tunit; /*EN< Unit of time measurement */ + /*JP< 時刻単位 */ + CriSint32 frame_id_per_data; /*EN< Frame ID of the movie data */ + /*JP< ムービデータごとのフレーム番号 */ + CriMvAlphaType alpha_type; /*EN< Composite mode */ + /*JP< アルファの合成モード*/ + void *detail_ptr; /* TEMP: for internal use */ + CriUint32 color_conversion_type; /*EN< Color space converion type. Fullrange or Limited.*/ + /*JP< 色変換タイプ。 */ +} CriMvAlphaFrameInfo; + +// 内部管理用。ムービ情報をユーザに渡す時はこれとほぼ同じだろうか。 +/* Information of USF File */ +typedef struct { + CriBool is_usf_file; + CriUint32 max_chunk_size; + CriUint32 min_buffer_size; + CriUint32 bitrate; + CriUint32 format_version; + /* Video */ + CriUint32 num_video; + CriMvPlyVideoHeader videohead[CRIMV_MAX_VIDEO_NUM]; + /* Audio */ + CriUint32 num_audio; + CriMvPlyAudioHeader audiohead[CRIMV_MAX_AUDIO_NUM]; + /* Subtitle */ + CriUint32 num_subtitle; + CriMvPlySubtitleHeader subtitlehead; + /* Alpha */ + CriUint32 num_alpha; + CriMvPlyAlphaHeader alphahead[CRIMV_MAX_ALPHA_NUM]; + /* CuePoint */ + CriUint32 num_cuepoint; + CriMvPlyCuePointHeader cuepointhead; +} CriMvPlyHeaderInfo; + +/* Video Elementary Stream */ +typedef struct { + CriUint32 fcid; + CriSint32 track_no; // チャンクのチャネル番号 + void *vdec; +} CriMvPlyVideo; + +typedef struct { + CriUint32 fcid; + CriSint32 track_no; // チャンクのチャネル番号 + void *dec; +} CriMvPlyAlpha; + +/* ムービヘッダを管理するための構造体 */ +typedef struct { + CriMvPlyHeaderInfo info; + CriBool write_new_head_flag; // CRIDが見つかって次のヘッダを書き込む準備ができたか? + CriUint32 num_remaining_adec_head; // 必要な残りのオーディオヘッダの数 + CriUint32 num_remaining_vdec_head; // 必要な残りのビデオのヘッダの数 + CriUint32 num_remaining_subtitle_head; // 必要な残りの字幕のヘッダの数 + CriUint32 num_remaining_alpha_head; // 必要な残りのアルファのヘッダ数 + CriUint32 num_remaining_cuepoint_head; // 必要な残りのキューポイントのヘッダ数 + /* 2010-08-19: TEMP: CONCAT_KAI: Don't refer this member. */ + CriUint64 accumulated_tcount; +} CriMvHeaderInfoContainer; + +typedef struct { + CriBool is_play_audio; + CriUint32 fcid; + CriUint32 track_no; // チャンクのチャネル番号 + void *adec; // 実際のオーディオコーデック + CriUint32 num_channel; // データのチャネル数 + CriUint32 sampling_rate; // サンプリング周波数 + CriUint32 output_buffer_samples; + CriSj sji; // UNI + CriSj sjo[CRIMV_PCM_BUFFER_MAX]; // RBF + CriUint32 sjo_bufsize[CRIMV_PCM_BUFFER_MAX]; + CriBool term_supply; // データ供給終了通知フラグ + CriBool is_working; // コンテンツチャンク処理中 + +#if defined(ENABLE_DYNAMIC_AUDIO_SWITCH) + CriUint32 next_track_no; // ユーザが指定した切替先のトラック番号 + CriUint32 last_track_switch_time; // 切替元のトラックの最後にチャンクをとった時刻 + CriUint32 last_track_switch_tunit; // 上記時刻の単位 (in Hz?) + CriMvPlyAmngTrackState switch_state; // トラック切替による状態 +#endif +} *CriMvPlyAdec, CriMvPlyAdecObj; + +typedef struct { + + CriMvPlyAdec mvply_adecs[NUM_MAX_ADEC]; + CriSint32 num_adecs; + CriUint32 size_smpl; + CriSj sji; + CriUint32 chunk_num_per_server; + + CriBool (*cbfunc_nofify_found_header)(void *usrobj, CriChunk *ckc, CriUint8 chno); + void *usrobj_nofify_found_header; + +} *CriMvPlyAmng, CriMvPlyAmngObj; + + +/* シークブロック情報 */ +typedef struct { + CriSint32 top_frame_id; +} CriMvSeekBlockInfo; + +/* ストリーマ用情報 */ +typedef struct { + CriUint32 max_chunk_size; + CriUint32 average_bitrate; +} CriMvStreamerInfo; + + +/* ハンドル作成用コンフィグ構造体 */ +typedef struct { + CriUint32 readbuffer_size; +} CriMvHandleConfig; + + +/*JP CRI Movie ハンドル */ +/*EN + * A handle for a single movie. If multiple movies are to be played simultaneously, + * create a CriMvPly handle for each movie. + * + * \sa criMvPly_Create(), criMvPly_Destroy() */ +typedef struct { + /*** Member variable is ***/ + CriBool used; + CriMvPlyStatus stat; + CriBool request_stop; + CriBool restrain_supply; + CriBool term_supply; + void *cs_work; + void *cshn; + /* USF Header */ + + CriMvHeaderInfoContainer headinfo_container[CRIMVPLY_HEAD_CONTAINER_NUM]; + Uint16 cur_dechead_idx; + CriUint32 cnt_dechead; /* ヘッダ解析ごとに更新 */ + CriUint32 cnt_concat; /* GetFrameで更新 */ + + CriMvPlyHeaderInfo headinfo; + CriUint32 num_headck; /* ヘッダ解析処理したチャンク数 */ + CriFloat32 def_buffering_time; + CriUint32 def_max_stream; + CriUint32 def_sound_output_buffer_samples; + CriSint32 def_track_play_audio; /* -1 でオーディオ再生無し */ + + /* デリゲートパラメータ構造体 */ + CriSint32 size_dlgparams; + CriUint8 *ptr_dlgparams; + + CriBool is_prepare_work; + CriMvStreamingParameters stmprm; /* ストリーミングパラメータの記録 */ + /* Demultiplexer */ + CriSint32 inputtype; /* ストリーミングかメモリか?メモリ=ユニSJ再生 */ + CriBool is_usf_data; /* 入力ファイルはUSFファイルか? */ + void *demux; /* USFデマルチプレクサハンドル */ + CriUint32 max_demuxout; /* デマルチプレクサ出力の最大種別数 */ + CriUint32 num_demuxout; /* デマルチプレクサ出力に設定済みの種別数 */ + CriSj headanaly_in_sj; // RBF + CriSj headanaly_out_sj; // UNI + CriSj read_sj; // RBF + CriChunk readck; + + CriSj memplay_sj; // UNI (for memory playback) + CriChunk movie_on_mem; /* メモリ指定のムービデータ記憶用(1個) */ + CriUint32 offset_content; /* メモリ指定先頭データのコンテンツ本体までのサイズ */ + + /* === ハンドル作成時に確保 === */ + CriHeap heap_gen; + /* ヘッダ解析用の読み込み領域 */ + CriUint32 headanaly_bufsize; + /* ハンドル内部メモリは最初に10kbyte確保して使いまわす。具体的にはヘッダ解析用。 */ + CriHeap local_heap; /* ハンドル内部専用Heap */ + CriSint32 local_bufsize; /* ハンドル内部専用Heap用のバッファサイズ */ + CriUint8 *local_bufptr; /* ハンドル内部専用Heap用のバッファポインタ */ + /* === メタワークバッファ (ヘッダ解析時に確保) === */ + CriHeap heap_meta; + /* === ワークバッファ作成時に確保 === */ + CriHeap heap_core; + /* 読み込みバッファ */ + CriUint32 size_readbuf_main; + CriUint32 size_readbuf_ext; + /* Video Decoder */ + CriMvPlyVideo video; + CriUint32 framerate_n; + CriUint32 framerate_d; + /* Audio Decoder */ + CriMvPlyAmng audio_mngr; + CriMvPcmFormat pcmfmt; + CriUint32 size_smpl; + CriHeap heap_audio2; + /* Subtitle */ + CriSj sjo_subtitle; + CriSint32 concat_subtitle_cnt; /* 字幕の連結処理回数 */ + CriSint32 ch_subtitle; /* 字幕の連結処理回数 */ + /* Alpha */ + CriMvPlyAlpha alpha; + + /* 折り返しチャンク対応用(使うかどうかに関係なく変数だけは定義する) */ + CriUint32 bufsize_read_main; /* 入力SJのバッファ本体サイズ */ + CriUint32 bufsize_read_ext; /* 入力SJののりしろサイズ */ + CriUint8 *read_sj_bufptr; /* 入力RBSJの先頭バッファアドレス */ + + /* ストリーミングパラメータに入れるという手段もアリかも? */ + CriSint32 seek_frame_id; /* シークしたいフレームID(GOPの途中の可能性あり) */ + CriSint32 video_gop_top_id; /* シーク後のビデオGOP先頭フレームID : 0以下でシーク無し */ + CriSint32 alpha_gop_top_id; /* シーク後のアルファGOP先頭フレームID : 0以下でシーク無し */ + CriBool seek_video_prep_flag; /* シーク再生のビデオ準備完了フラグ(GOP途中まで進んだか?) */ + CriBool seek_alpha_prep_flag; /* シーク再生のアルファ準備完了フラグ(GOP途中まで進んだか?) */ + CriBool seek_audio_prep_flag; /* シーク再生のオーディオ準備完了フラグ(シーク指定時刻まで捨てたか?) */ + + CriSint32 dechdr_stage; /* DECHDRの進み具合 */ + CriSint32 sji_meta_bufsize; /* メタデータ用入力バッファサイズ */ + CriSj sji_meta; /* メタデータ用入力SJ */ + CriUint32 cnt_meta_ck; /* メタデータ用入力SJ */ + void *video_seektbl_ptr; + CriUint32 video_seektbl_size; + CriSint32 video_gop_num; + void *alpha_seektbl_ptr; + CriUint32 alpha_seektbl_size; + CriSint32 alpha_gop_num; + + void *audio_header_ptr[CRIMV_MAX_AUDIO_NUM]; + CriUint16 audio_header_size[CRIMV_MAX_AUDIO_NUM]; + + void *cuepoint_meta_ptr; + CriUint32 cuepoint_meta_size; + CriMvCuePointInfo cuepoint_info; + + CriMvInputBufferInfo ibuf_info; + CriFloat32 reload_sec_threshold; + + CriSint32 num_frames_for_prep; + + /* For Sofdec2 */ + CriHeap heap_playback; + CriMvMetaDataWorkMallocFunc cbfunc_meta_alloc; + CriMvMetaDataWorkFreeFunc cbfunc_meta_free; + void* usrobj_meta_data; + void* meta_data_work_allocated; /* ユーザアロケータで確保されたメタデータワーク */ + void* event_table_work_allocated; /* ユーザアロケータで確保されたイベントテーブル */ + CriMvStreamerInfo streamer_info; + + /* OUTER_FRAMEPOOL_WORK */ + CriMvFramepoolWorkMallocFunc cbfunc_framepool_alloc; + CriMvFramepoolWorkFreeFunc cbfunc_framepool_free; + void* usrobj_framepool; + void* framepool_work_allocated; /* ユーザアロケータで確保されたフレームプールワーク(解放必要) */ + void* framepool_work_set; /* 直接バッファ指定されたフレームプールワーク(解放不要) */ + + /* For Debug */ + volatile CriUint8 end_sequence_info; + CriUint64Adr header_ptr; + CriSint64 header_size; + CriUint64Adr body_ptr; + CriSint64 body_size; + + CriBool sync_flag; + + CriBool error_flag; + +#if defined(XPT_TGT_IOS) + CriChar8 vavfios_filepath[CRIMVPLY_VAVFIOS_MAX_FILEPATH]; +#endif + + /* For Tools */ + void *extended_mvinfo_config; + + /* ハンドル作成コンフィグ関連 */ + CriBool use_hn_config_flag; /* ハンドル作成コンフィグ指定があったかどうか */ + CriMvHandleConfig hn_config; + +} *CriMvPly, CriMvPlyObj; + +/*************************************************************************** + * Function Declaration + ***************************************************************************/ + +#ifdef __cplusplus +extern "C" { +#endif + +/* ライブラリ初期化 */ +/* + * \brief ライブラリの初期化 + * \param なし + * \return なし + * \par 説明: + * ライブラリの初期化を行います。
+ * 複数回連続で初期化した場合は、最初の1回のみ初期化処理を実行します。 + */ +/* + * \ingroup MODULE_INIT + * \brief Initialize library + * + * This function initializes the CRI Movie library, including internal audio, + * streaming and video subsystems. This function must be + * called before any other function in this library will work properly. + * This function initializes only the first time it is called; if it is + * called again, it simply increments an internal counter and returns; it + * does not re-initialize, nor does it create an error condition. + * + * Therefore, it is safe to call criMvPly_Initialize() and criMvPly_Finalize() + * at the beginning and end, respectively, within each of the independent + * modules in your program. If you match these functions call for call, + * only the first criMvPly_Initialize() function and the last criMvPly_Finalize() + * functions should have any effect. + * + * \sa criMvPly_Finalize() + */ +void CRIAPI criMvPly_Initialize(void); + +/* ライブラリ終了 */ +/* + * \brief ライブラリ終了 + * \param なし + * \return なし + * \par 説明: + * ライブラリの終了処理を行います。
+ * 複数回初期化をしていた場合は、同じ回数だけ終了処理を実行してください。 + */ +/* + * \ingroup MODULE_INIT + * \brief Finalize library + * + * This function deallocates any resources in use by the library. + * It should be called the same number of times that the criMvPly_Initialize() + * function is called. If the criMvPly_Initialize() function is called n + * times, on the nth time the criMvPly_Finalize() function is called, + * criMvPly_Finalize() releases any resources allocated by CRI Movie. + * + * Therefore, it is safe to call criMvPly_Initialize() and criMvPly_Finalize() + * at the beginning and end, respectively, within each of the independent + * modules in your program. If you match these functions call for call, + * only the first criMvPly_Initialize() function and the last criMvPly_Finalize() + * functions should have any effect. + * + * \sa criMvPly_Initialize() + */ +void CRIAPI criMvPly_Finalize(void); + +/* ハンドル作成 */ +/* + * \brief ハンドル作成 + * \param heap : メモリ確保に使用するHeapハンドル + * \return CriMvPlyハンドル + * \par 説明: + * CRI Movie ハンドルを作成します。
+ * 必要なハンドル管理領域はHeapハンドルを使って自動的に確保します。
+ * 作成直後のハンドル状態はSTOP状態です。 + */ +/* + * \ingroup MODULE_INIT + * \brief Create a handle + * \param heap A valid CriHeap handle + * \return A valid CriMvPly handle, or NULL if the handle cannot be allocated + * + * This function creates a CriMvPly handle in the CRIMVPLY_STATUS_STOP state. + * Memory for the handle is allocated from the CriHeap structure that you provide. + * Any memory allocation failure during this function results in a text error message to output, and the program hangs. + * Make sure to initialize and create your heap with criHeap_Initialize() and + * criHeap_Create() before calling this function. + * + * \sa CriMvPly, CriMvPlyStatus, criHeap_Initialize(), criHeap_Create() + */ +CriMvPly CRIAPI criMvPly_Create(CriHeap heap); + +/* コンフィグ指定のハンドル作成 */ +/* config がNULL指定の場合はコンフィグ指定無しと同様 */ +CriMvPly CRIAPI criMvPly_CreateWithConfig(CriHeap heap, CriMvHandleConfig *config); + +/* ハンドル破棄 */ +/* + * \brief ハンドル破棄 + * \param mvply : CRI Movie ハンドル + * \return なし + * \par 説明: + * CRI Movie ハンドルの破棄を行います。
+ * ハンドル作成時に引数で指定したHeapハンドルを使って、ハンドル管理領域を解放します。
+ * ワークバッファを確保したままの場合は、ワークバッファ確保時に指定したHeapハンドルを使ってワークバッファも解放します。
+ * ハンドルの破棄は、ハンドル状態がSTOPかPLAYENDの時にしか実行できません。 + */ +/* + * \ingroup MODULE_INIT + * \brief Destroy a handle + * \param mvply A valid CriMvPly handle to be destroyed + * + * This function destroys the CriMvPly handle previously created + * with criMvPly_Create(). + * + * You can only destroy the handle if it is in either the CRIMVPLY_STATUS_STOP or the + * the CRIMVPLY_STATUS_PLAYEND states. Attempting to destroy the handle in + * any other state will produce an error message. You can check the status of + * the handle at any time with criMvPly_GetStatus(). + * + * Any work buffers allocated via criMvPly_AllocateWorkBuffer(), if they are + * still associated with the handle, are freed when criMvPly_Destroy() is called. + * + * \sa CriMvPly, CriMvPlyStatus, criMvPly_GetStatus(), criMvPly_AllocateWorkBuffer() + */ +void CRIAPI criMvPly_Destroy(CriMvPly mvply); + +/* ストリーミングパラメータの取得 */ +/* + * \brief ストリーミングパラメータの取得 + * \param mvply : CRI Movie ハンドル + * \param stmprm : ストリーミングパラメータ + * \return なし + * \par 説明: + * ヘッダ解析の結果をもとに、ムービ再生に必要なストリーミングパラメータを取得します。
+ * ハンドル状態がWAIT_PREPになると取得できるようになります。
+ * このパラメータをもとにcriMvPly_AllocateWorkBuffer関数を呼び出すことができます。
+ * 必要ならばこのパラメータの値を変更して、例えば音ありムービで音を再生しない、といったことも可能です。
+ */ +/* + * \ingroup MODULE_BUFFER + * \brief Get streaming parameters + * \param mvply A valid CriMvPly handle + * \param stmprm An empty CriMvStreamingParameters structure to be filled with data + * + * This function permits you to get detailed information about the stream and + * dynamically allocate resources just before the video and audio sequence + * begins playback. + * + * This function does nothing if the current state of the CriMvPly handle is + * CRIMVPLY_STATUS_DECHDR or CRIMVPLY_STATUS_STOP. The only useful state in + * which to call criMvPly_GetStreamingParameters() is the CRIMVPLY_WAIT_PREP + * status. When the CriMvPly handle is in the CRIMVPLY_WAIT_PREP status, + * calling this function will cause the CriMvStreamingParameters field to be + * filled with data. + * + * Some of the CriMvStreamingParameters, such as buffering time and the + * maximum number of files to read, are copied from the CriMvPly structure. + * However, maximum bitrate, video size, audio stream rate and channel + * info are calculated from the incoming stream. + * + * After calling criMvPly_GetStreamingParameters(), you can programmatically + * override any of the fields in the CriMvStreamingParameters struct yourself + * before calling criMvPly_AllocateWorkBuffer() with it. For example, you might + * need to read a stream containing both audio and video, but only output the + * video from the stream. In this case you could allocate trivial audio buffers + * for output by modifying the CriMvStreamingParameters struct accordingly after + * calling this function. + * + * \sa criMvPly_AllocateWorkBuffer(), CriMvPly, CriMvStreamingParameters + */ + void CRIAPI criMvPly_GetStreamingParameters(CriMvPly mvply, CriMvStreamingParameters *stmprm); + +/* ワークバッファの確保 */ +/* + * \brief ワークバッファの確保 + * \param mvply : CRI Movie ハンドル + * \param heap : + * \param stmprm : ストリーミングパラメータ + * \return なし + * \par 説明: + * 引数のHeapハンドルを使って、読み込みバッファやビデオ/オーディオのワークバッファを確保します。
+ * この関数を呼び出し可能なのは、STOP状態かWAIT_PREP状態の時のみです。
+ * 同じハンドルに対して2度呼び出すと、1度目のワークバッファを全て解放してから、改めてワークバッファを確保します。
+ * criMvPly_Start関数よりも先にワークバッファを確保しておくこともできます。 + */ +/* + * \ingroup MODULE_BUFFER + * \brief Allocate internal streaming work buffers + * \param mvply A CriMvPly handle + * \param heap A CriHeap handle + * \param stmprm An initialized CriMvStreamingParameters structure + * + * This function allocates internal streaming buffers for the CriMvPly movie + * player from the CriHeap. The amount of memory required is based + * on the maximum bitrate of the stream, the requested buffering time, the + * maximum chunk size, and the height and width of the incoming video frame. + * However, a small amount of memory is allocated for the + * video and audio decoders from the CriHeap as well. + * + * The CriHeap handle passed as a parameter to this function need not + * be the same CriHeap handle you passed to the criMvPly_Create() function. + * You may prefer to use either one or two heaps. + * + * This function can be called only if the CriMvPly handle is in the + * CRIMVPLY_STATUS_STOP or the CRIMVPLY_STATUS_WAIT_PREP status. Calling + * this function any other time will produce an error message. + * + * If this function is called twice without calling criMvPly_FreeWorkBuffer(), + * it releases the previously allocated buffers before allocating them again. + * + * This function must be called sometime before criMvPly_Start(). + * + * \if ps2 + * \par PS2 only: + * The PS2 implementation of this function additionally allocates buffers for + * internal DMA tags. If these allocations fail due to lack of memory, the + * library will hang. + * \endif + * + * \sa CriMvPly, CriHeap, CriMvPlyStatus, CriMvStreamingParameters, criMvPly_FreeWorkBuffer(), + * criMvPly_Start() + */ +CriBool CRIAPI criMvPly_AllocateWorkBuffer(CriMvPly mvply, CriHeap heap, CriMvStreamingParameters *stmprm); + +/* ワークバッファの解放 */ +/* + * \brief ワークバッファの解放 + * \param mvply : CRI Movie ハンドル + * \return なし + * \par 説明: + * criMvPly_AllocateWorkBuffer関数で確保したワークバッファを全て解放します。
+ * この関数を呼び出し可能なのは、STOP/WAIT_PREP/PLAYEND状態の時のみです。
+ * CRI Movie Ver.0.60 では未実装です。 + */ +/* + * \ingroup MODULE_BUFFER + * \brief Release streaming work buffer + * \param mvply A valid CriMvPly handle + * + * This function releases streaming work buffers allocated from the CriHeap + * previously associated with criMvPly_AllocateWorkBuffer(). + * This function should only be called at CRIMVPLY_STATUS_STOP, + * CRIMVPLY_STATUS_WAIT_PREP or CRIMVPLY_STATUS_PLAYEND states. However, this + * function does not verify the current stream status before releasing + * all the buffers; it merely deallocates them. Expect interesting crashes + * if you call this function while playing a movie. + * + * You can verify the current CriMvPly handle status with criMvPly_GetStatus() if + * necessary. + * + */ +void CRIAPI criMvPly_FreeWorkBuffer(CriMvPly mvply); + +/* 再生するオーディオチャネルの設定 */ +/* + * \brief 再生するオーディオチャネルの設定 + * \param mvply : CRI Movie ハンドル + * \param ch : オーディオチャネル番号 + * \return なし + * \par 説明: + * CriMvStreamingParameters構造体のメンバ track_play_audioのデフォルト値を設定します。
+ * criMvPly_GetStreamingParameters関数でCriMvStreamingParameters構造体を取得したときにこの値が格納されます。
+ * 何も設定していない場合、buffering_timeには0が入います。 + * -1を指定するとオーディオを再生しない設定になります。 + */ +void CRIAPI criMvPly_SetAudioTrack(CriMvPly mvply, CriSint32 track); + +/* バッファリング時間(単位[sec])の設定 */ +/* + * \brief バッファリング時間(単位[sec])の設定 + * \param mvply : CRI Movie ハンドル + * \param time : バッファリング時間 + * \return なし + * \par 説明: + * CriMvStreamingParameters構造体のメンバbuffering_timeのデフォルト値を設定します。
+ * criMvPly_GetStreamingParameters関数で CriMvStreamingParameters構造体を取得したときにこの値が格納されます。
+ * 何も設定していない場合、buffering_timeには1.0秒が入っています。 + */ +/* + * \ingroup MODULE_BUFFER + * \brief Set default buffering time (unit[sec]) + * \param mvply A valid CriMvPly handle + * \param time Buffering time in seconds + * + * This function tells the CriMvPly handle how much time of the stream to buffer in + * memory. Buffering is necessary to cover seeks, error retries, latency and + * other various hiccups in most data sources. + * + * This value is stored in the buffering_time field of the CriMvStreamingParameters + * struct. It is set to a default of 1.0 seconds when the CriMvPly handle is created. + * This is typically safe for most DVD type file systems. + * + * \sa CriMvPly, CriMvStreamingParameters + */ +//void CRIAPI criMvPly_SetBufferingTime(CriMvPly mvply, CriFloat32 time); + +/* 同時読み込みファイル数の設定 */ +/* + * \brief 同時読み込みファイル数の設定 + * \param mvply : CRI Movie ハンドル + * \param max_stm : 同時読み込みファイル数 + * \return なし + * \par 説明: + * CriMvStreamingParameters構造体のメンバmax_simultaneous_read_filesのデフォルト値を設定します。
+ * criMvPly_GetStreamingParameters関数で CriMvStreamingParameters構造体を取得したときにこの値が格納されます。
+ * 何も設定していない場合、max_simultaneous_read_filesには1が入っています。 + */ +/* + * \ingroup MODULE_BUFFER + * \brief Set maximum number of simultaneous streams + * \param mvply A valid CriMvPly handle + * \param max_stm The maximum number of simultaneous streams + * + * This function sets the default value of the "max_simultaneous_read_files" field of + * the CriMvStreamingParameters struct. Currently, setting this value has no effect. + */ +//void CRIAPI criMvPly_SetMaxSimultaneousStreams(CriMvPly mvply, CriUint32 max_stm); + +/* サウンド出力バッファサンプル数の設定 */ +/* + * \brief GetWave16で要求する最大サンプル数の設定 + * \param mvply : CRI Movie ハンドル + * \param max_smpl : 最大サンプル数 + * \return なし + * \par 説明: + * CriMvAudioParameters構造体のメンバoutput_buffer_samplesのデフォルト値を設定します。
+ * criMvPly_GetStreamingParameters関数で CriMvStreamingParameters構造体を取得したときにこの値が格納されます。
+ * 何も設定していない場合、output_buffer_samplesには16*1024が入っています。 + */ +/* + * \ingroup MODULE_AUDIO + * \brief Set default sound output buffer samples + * \param mvply A valid CriMvPly handle + * \param smpls : sound output buffer samples + * + * This function sets the default value of the "output_buffer_samples" field in the + * CriMvAudioParameters struct. The default value is 16384, which is set when + * criMvPly_Create() is called. + * + * This function only has an effect if it is called before the + * criMvPly_AllocateWorkBuffer() function is called, since this is when the audio + * output buffer is allocated. + * + * \sa CriMvAudioParameters, criMvPly_Create(), criMvPly_AllocateWorkBuffer(), + * criMvPly_GetWave16() + */ +//void criMvPly_SetMaxSamplesOfGetWave16(CriMvPly mvply, CriUint32 max_smpl); +void CRIAPI criMvPly_SetSoundOutputBufferSamples(CriMvPly mvply, CriUint32 smpls); + +/* ハンドル状態の取得 */ +/* + * \brief ハンドル状態の取得 + * \param mvply : CRI Movie ハンドル + * \return ハンドル状態 + * \par 説明: + * ハンドル状態を取得します。 + */ +/* + * \ingroup MODULE_STATE + * \brief Get the handle status + * \param mvply A valid CriMvPly handle + * \return One of the CriMvPlyStatus enum values + * + * This function gets the current status of the CRI Movie handle. Check the + * following link for possible return values. + * + * \sa CriMvPlyStatus + */ +CriMvPlyStatus CRIAPI criMvPly_GetStatus(CriMvPly mvply); + +/* WAIT状態から次の状態への遷移通知 */ +/* + * \brief WAIT状態から次の状態への遷移通知 + * \param mvply : CRI Movie ハンドル + * \return なし + * \par 説明: + * ハンドル状態をWAIT_**** 状態から次の状態に遷移させます。状態に応じて次のように使用します。
+ * ・WAIT_PREP 状態 : criMvPly_AllocateWorkBuffer関数でワークを確保しおわったら呼び出してください。
+ * ・WAIT_PLAYING 状態 : ビデオフレーム、オーディオデータを取得して表示・出力の準備ができたら、 + * 出力を開始して、本関数を呼び出してください。
+ * ・WAIT_PLAYEND 状態 : 最後のビデオフレームの表示、最後のオーディオデータの出力が終了したら呼び出してください。
+ * ・WAIT_STOP 状態 : ビデオやオーディオの出力が停止してもいい状態になったら、呼び出してください。
+ * 本関数を呼び出すと各状態は即座に次の状態に遷移します。
+ * 本関数を WAIT_**** 以外の状態で呼び出しても、状態は何も変わりません。 + */ +/* + * \ingroup MODULE_STATE + * \brief Notify transition from WAIT status + * \param mvply A valid CriMvPly handle + * + * This function notifies the CriMvPly handle that your application is ready to + * go from the current WAIT state to the next state. There are exactly four states + * in which it is appropriate to call this function: + * + * - CRIMVPLY_STATUS_WAIT_PREP After your application has allocated buffers with + * criMvPly_AllocateWorkBuffer() + * - CRIMVPLY_STATUS_WAIT_PLAYING After your application has prerolled stream data (if + * necessary) + * - CRIMVPLY_STATUS_WAIT_PLAYEND After your application has displayed the last frames of audio and + * video from the stream + * - CRIMVPLY_STATUS_WAIT_STOP After your application suspends playback from the stream + * + * You can check the current status of the CriMvPly handle by calling the criMvPly_GetStatus() + * function. This function has no effect if called in states other than those listed above. + * + * \sa CriMvPly, CriMvPlyStatus + */ +void CRIAPI criMvPly_IncrementState(CriMvPly mvply); + +/* 状態の更新 */ +/* + * \brief CriMvPlyモジュールのサーバ関数 + * \param mvply : CRI Movie ハンドル + * \return なし + * \par 説明: + * 主にデマルチプレクサ内部のデータの更新を行います。
+ * 本関数はアプリケーションのメインスレッド側でで毎回呼び出すようにしてください。
+ */ +void CRIAPI criMvPly_Update(CriMvPly mvply); + +/* 再生開始 */ +/* + * \brief 再生開始 + * \param mvply : CRI Movie ハンドル + * \return 再生開始できた場合はCRI_TRUE, 失敗した場合はCRI_FALSE + * \par 説明: + * 再生のための処理を開始します。
+ * 本関数呼出し後、ハンドル状態はDECHDRに遷移します。
+ */ +/* + * \ingroup MODULE_STATE + * \brief Start of playback processing + * \param mvply A valid CriMvPly handle + * + * This function initiates playback processing. This function should be called + * after the CriMvPly handle is created and the data source has been opened, + * but before the work buffers are allocated with criMvPly_AllocateWorkBuffer(). + * This function sets the current status of the CriMvPly handle to + * CRIMVPLY_STATUS_DECHDR, which prepares it to decode the header information + * from the data source. + * + * \sa CriMvPly, CriMvPlyStatus, criMvPly_AllocateWorkBuffer() + */ +CriBool CRIAPI criMvPly_Start(CriMvPly mvply); + +/* 再生停止リクエスト(即時復帰) */ +/* + * \brief 再生停止リクエスト(即時復帰) + * \param mvply : CRI Movie ハンドル + * \return なし + * \par 説明: + * 再生停止のリクエストを発行して即時復帰します。
+ * 本関数呼出し後、ハンドル状態はSTOP_PROCESSING状態に遷移します。
+ * 停止のための処理が終わると、ハンドル状態がWAIT_STOPに遷移します。
+ * WAIT_STOP状態になったら、criMvPly_IncrementState関数でSTOP状態に遷移させて、 + * アプリケーションの停止処理を行ってください。 + */ +/* + * \ingroup MODULE_STATE + * \brief Non-blocking request to stop playback + * \param mvply A currently playing CriMvPly handle + * + * This function records a request to terminate playback. Termination of + * playback is not synchronous to this function; this function sets the current + * state of the CriMvPly handle to CRIMVPLY_STATUS_STOP_PROCESSING. After + * movie processing is halted, the state of the handle transitions to + * CRIMWPLY_STATUS_WAIT_STOP. + * + * This function is useful for prematurely terminating a movie, e.g. "press + * X to skip this movie". + * + * Video frames will keep being delivered until you detect a CRIMVPLY_STATUS_WAIT_STOP + * state in the CriMvPly handle, and then call criMvPly_IncrementState to transition + * back to the CRIMVPLY_STATUS_STOP state. + * + * \note Pausing is not accomplished through this function. The system clock, including + * whether or not to pause or advance frames, is controlled entirely through user + * code. So the effect of "pausing" a CriMvPly handle can be accomplished by simply + * not updating your system clock as long as your pause is in effect. + * + * \sa CriMvPly, CriMvPlyStatus + */ +void CRIAPI criMvPly_Stop(CriMvPly mvply); + +/* サーバ処理(ハンドル指定) */ +/* + * \brief サーバ処理(ハンドル指定) + * \param mvply : CRI Movie ハンドル + * \return なし + * \par 説明: + * CRI Movie ハンドルを指定してサーバ処理を実行します。
+ * 各WAIT_**** 状態への状態遷移はサーバ関数内で実行されます。 + */ +/* + * \ingroup MODULE_VIDEO + * \brief Execute heartbeat functions for a handle + * \param mvply A valid CriMvPly handle + * + * This function executes heartbeat functions for the specified CriMvPly handle only, + * including handoff and parsing of input buffers and audio decoding. Additionally, + * it checks for buffer situations in which the CriMvPly handle should transition to + * one of the four WAIT states of CriMvPlyStatus, and it makes these transitions if + * necessary. + * + * However, video decoding does NOT occur in criMvPly_Execute(). + * + * Expect that criMvPly_Execute() will take a relatively low CPU load. Typically, + * this function should be called on every vertical blank. However, it may be called + * more frequently in a CriMvPly wait state, in conjunction with criMvPly_IncrementState(), + * in order to "force" a transition into the next state without waiting for + * another vertical blank. This type of transition is not generically + * necessary. + * + * \sa CriMvPly, CriMvPlyStatus, criMvPly_ExecuteAll() + */ +void CRIAPI criMvPly_Execute(CriMvPly mvply); + +/* ファイル読み込みバッファの空きチャンク取得 */ +/* + * \brief ファイル読み込みバッファの空きチャンク取得 + * \param mvply : CRI Movie ハンドル + * \param ck : チャンク + * \return なし + * \par 説明: + * ファイル読み込みバッファの空き領域を取得します。
+ * 取得した空き領域(チャンクと呼びます)は、データ書き込みを通知するさいに + * そのまま使用しますので、アプリケーションで記憶してください。
+ * 1度に取得できるチャンクは1つのみです。
+ * チャンクが取得できたか否かは、チャンクのサイズで判定できます。
+ * データの書き込みが終わったら、criMvPly_PutInputChunk関数で書き込みサイズを通知してください。
+ */ +/* + * \ingroup MODULE_SUPPLY + * \brief Get a free chunk from file reading buffer + * \param mvply A valid CriMvPly handle + * \param ck A CriChunk structure to be filled with data by this function + * + * This function selects an empty internal buffer for your data source to read its data into. + * An area of this type is referred to as a "chunk." + * After calling this function, the ck->data and ck->size + * fields will provide a valid pointer and size, respectively, that your data + * source should copy its data into. + * If no buffers can internally be allocated, this function will return 0 as the + * ck->size field. If this occurs, your program should choke input until a free + * buffer can be allocated. + * Typical data sources are native file reading, sequential memory access, or + * playback from a network source. + * The ck->size field is dynamically calculated when criMvPly_AllocateWorkBuffer() + * is called; it is calculated based on expected data rate and video resolutions + * embedded in the stream file. + * + * After you receive a valid chunk from criMvPly_GetInputChunk(), + * you can fill the provided chunk up to the ck->size limit. After you + * fill the chunk with valid data, call the criMvPly_PutInputChunk() function + * to queue the data for processing. The functions criMvPly_GetInputChunk() and + * criMvPly_PutInputChunk() should be called in equal pairs; calling these + * functions out of order will produce odd results. No dynamic chunk reordering + * is permitted; serial calls with out-of-order chunks will be + * flagged at run-time as an error. + * + * This function will only return a valid chunk if the CriMvPly handle is in + * one of two playback states: CRIMVPLY_STATUS_PLAY or CRIMVPLY_STATUS_DECHDR. + * You can verify the current playback state with criMvPly_GetStatus(). + * + * \sa criMvPly_GetStatus(), criMvPly_PutInputChunk(), criMvPly_AllocateWorkBuffer(), + * CriChunk, CriMvPlyStatus + */ +void CRIAPI criMvPly_GetInputChunk(CriMvPly mvply, CriChunk *ck); + +/* ファイル読み込みバッファへのデータ書き込み通知 */ +/* + * \brief ファイル読み込みバッファへのデータ書き込み通知 + * \param mvply : CRI Movie ハンドル + * \param ck : + * \param inputsize : + * \return なし + * \par 説明: + * criMvPly_GetInputChunk関数で取得した空き領域(チャンクと呼びます)に + * データを書き込み終わったら、引数inputsizeにデータサイズを入れて本関数を呼び出してください。
+ * その際、チャンクは criMvPly_GetInputChunk関数で取得したものと同じチャンクを必ず指定してください。 + */ +/* + * \ingroup MODULE_SUPPLY + * \brief Put a data chunk into file read buffer + * \param mvply A valid CriMvPly handle + * \param ck A CriChunk structure containing source data + * \param inputsize The number of bytes actually supplied + * + * This function informs the CriMvPly handle that the CriChunk structure + * now contains valid data from the data source. Typically, you would call + * this function after your asynchronous file read reports that the buffer is + * full of data. + * + * The inputsize field should contain the number of bytes actually provided. + * This value can be less than or equal to ck->size. In an end-of-file condition, + * be sure to supply the actual number of bytes remaining in the file, and not + * merely the size of the input buffer, to criMvPly_PutInputChunk(). + * Do not modify the contents of the CriChunk after calling this function; + * instead, call criMvPly_GetInputChunk() to get a new chunk for further input. + * + * This function invalidates the CriChunk provided if the function is called + * while the CriMvPly handle is in the CRIMVPLY_STATUS_STOP, the + * CRIMVPLY_STATUS_WAIT_PREP, or the CRIMVPLY_STATUS_STOP_PROCESSING state. + * You can verify the current playback state with criMvPly_GetStatus(). + * + * After you receive a valid chunk from criMvPly_GetInputChunk(), + * you can fill the provided chunk up to the ck->size limit. After you call + * fill the chunk with valid data, call the criMvPly_PutInputChunk() function + * to queue the data for processing. The function criMvPly_GetInputChunk() and + * criMvPly_PutInputChunk() should be called in equal pairs; calling these + * functions out of order will produce odd results. No dynamic chunk reordering + * is permitted; serial calls with out-of-order chunks will be + * flagged at run-time as an error. + * + * After putting the final chunk of data in the stream, call + * criMvPly_TerminateSupply() to indicate that an end-of-file condition exists. + * + * \sa criMvPly_GetStatus(), criMvPly_GetInputChunk(), criMvPly_AllocateWorkBuffer(), + * criMvPly_TerminateSupply(), CriChunk, CriMvPlyStatus + */ +void CRIAPI criMvPly_PutInputChunk(CriMvPly mvply, CriChunk *ck, CriUint32 inputsize); + +/* ファイル読み込み終了の通知 */ +/* + * \brief ファイル読み込み終了の通知 + * \param mvply : CRI Movie ハンドル + * \return なし + * \par 説明: + * 再生したい全てのデータを読み込んで、 criMvPly_PutInputChunk関数で通知し終わったら、 + * 本関数でファイル読み込み終了の通知を必ず行ってください。
+ * 終了を通知された時点で読み込みバッファに書き込まれた全てのデータをデコードし終わると、 + * ハンドル状態はWAIT_PLAYENDに遷移します。
+ * 本関数を呼び出さない限り、WAIT_PLAYEND状態になることはありません。 + */ +/* + * \ingroup MODULE_SUPPLY + * \brief Notify end of reading data + * \param mvply A valid CriMvPly structure + * + * After you put all the source data into the CriMvPly handle with + * criMvPly_PutInputChunk(), indicate the end of the movie file by calling + * criMvPly_TerminateSupply(). After calling this function, the CriMvPly + * handle's status is changed by the library to CRIMVPLY_STATUS_WAIT_PLAYEND + * and the library completes processing of whatever frames it has internally + * buffered. + * + * If you do not call this function, the CriMvPly handle will never transition + * to the CRIMVPLY_STATUS_WAIT_PLAYEND state, making teardown impossible. + * + * \sa criMvPly_PutInputChunk(), CriMvPly, CriMvPlyStatus + */ +void CRIAPI criMvPly_TerminateSupply(CriMvPly mvply); + +#if 0//defined(XPT_TGT_EE) +/* RGB32フォーマットのビデオフレームの取得 */ +/* + * \if ps2 + * \brief RGB32フォーマットのビデオフレームの取得 + * \param mvply : CRI Movie ハンドル + * \param imagebuf : ビデオフレームバッファ + * \param bufsize : バッファサイズ + * \param frameinfo : フレーム情報 + * \return 取得できた場合はTRUE, できなかった場合はFALSE + * \par 説明: + * 引数で指定したバッファに、PS2のマクロブロック並びRGBA32フォーマットでフレームを取得します。
+ * 引数CriMvFrameInfo構造体には、取得したフレームについての情報が格納されます。
+ * フレームが取得できるのは、ハンドル状態がWAIT_PLAYING/PLAYINGの時のみです。
+ * それ以外の状態で呼び出す、または入力データ不足の場合には、本関数はフレームの取得に失敗し、即座に復帰します。
+ * フレームが取得できなかった場合は、関数値でFALSEが返ります。
+ * 実際のビデオデコード処理も本関数内で動くため、フレーム取得できる場合には、処理の重い関数となります。 + * \endif + */ +/* + * \if ps2 + * \ingroup MODULE_VIDEO + * \brief Get a video frame in PS2 macroblock RGB32 format + * \param mvply A valid CriMvPly handle + * \param imagebuf a pointer to the video buffer in memory to receive the frame + * \param bufsize video buffer size in bytes + * \param frameinfo Information about the decoded frame + * \return returns true if a frame has been copied into the buffer, false otherwise + * + * This function finds and decodes the current frame, if any, to the imagebuf buffer. + * The format of this buffer is specific to the PS2. This function will only return + * a valid frame if the CriMvPly handle is in the CRIMVPLY_STATUS_WAIT_PLAYING or the + * CRIMVPLY_STATUS_PLAYING state. + * + * This function is an EE-intensive activity, and the amount of time required + * is variable, depending on the complexity and size of the video frame being decoded. + * Therefore the preferred method of calling this function is in a low priority thread, + * separate from your I/O, buffer management, and criMvPly_Execute() routines. + * + * If this function returns true, the preferred display time of the video frame is calculated + * as: + * + * \code + * frameinfo.time / frameinfo.tunit + * \endcode + * + * Humans notice audio stuttering much more readily than a dropped video frame during + * a video decode process. If the frame reported by criMvPly_GetFrameRGBA32_PS2() + * arrives after your system clock says the frame should be displayed, you should + * simply drop the frame without bothering to DMA it to video memory. + * + * Here is an example showing how to drop frames in this case: + * + * \dontinclude crimvt01_simple_playback_ps2.c + * \skip Get video frame + * \until *tutor_update_video_frame_on_display_time* + * + * It is not preferred, but it is possible, to call this function in a single-threaded + * playback model. In this case, it is important to allocate more heap space + * and service the CriMvPly handle with criMvPly_Execute() or criMvPly_ExecuteAll() + * frequently, as well as criMvPly_GetWave16() frequently. This helps to cover + * for the case where other I/O needs to occur when a frame is currently being decoded by + * criMvPly_GetFrameRGBA32_PS2(). + * + * \image html crimvply_getframergba32_ps2.png The DMA reordering step on PS2 + * + * In order to get acceptable performance on the PS2, a macroblock reordering step + * must take place during the DMA transfer from EE RAM to video RAM. + * \endif + */ +CriBool CRIAPI criMvPly_GetFrameRGBA32_PS2(CriMvPly mvply, CriUint8 *imagebuf, CriUint32 bufsize, CriMvFrameInfo *frameinfo); + +CriBool CRIAPI criMvPly_DecodeFrameRGBA32_PS2(CriMvPly mvply, CriUint8 *imagebuf, CriUint32 bufsize, CriMvFrameInfo *frameinfo); +#endif + +#if defined(XPT_TGT_PC) || defined(XPT_TGT_XBOX360) || defined(XPT_TGT_WII) || defined(XPT_TGT_SH7269) || defined(XPT_TGT_TRGP6K) +/* + * \if pc + * \ingroup MODULE_VIDEO + * \brief Get a video frame in YUV422 format + * \param mvply A valid CriMvPly handle + * \param imagebuf A pointer to the video buffer in memory to receive the frame + * \param pitch Number of bytes in one row of the video buffer + * \param bufsize Video buffer size in bytes + * \param frameinfo Information about the decoded frame + * \return returns true if a frame has been copied into the buffer, false otherwise + * + * This function finds and decodes the current frame, if any, to the imagebuf buffer. + * This function will only return a valid frame if the CriMvPly handle is in the + * CRIMVPLY_STATUS_WAIT_PLAYING or the CRIMVPLY_STATUS_PLAYING state. + * + * This function is a CPU-intensive activity, and the amount of time required + * is variable, depending on the complexity and size of the video frame being decoded. + * Therefore the preferred method of calling this function is in a low priority thread, + * separate from your I/O, buffer management, and criMvPly_Execute() routines. + * + * If this function returns true, the preferred display time of the video frame is calculated + * as: + * + * \code + * frameinfo.time / frameinfo.tunit + * \endcode + * + * It is not preferred, but it is possible, to call this function in a single-threaded + * playback model. In this case, it is important to allocate more heap space + * and service the CriMvPly handle with criMvPly_Execute() or criMvPly_ExecuteAll() + * frequently, as well as criMvPly_GetWave16() frequently. + * + * \endif + */ +CriBool CRIAPI criMvPly_GetFrameYUV422(CriMvPly mvply, CriUint8 *imagebuf, CriUint32 pitch, CriUint32 bufsize, CriMvFrameInfo *frameinfo); +#endif + +/* 16bit WAVEフォーマットのオーディオデータ取得 */ +/* + * \brief 16bit WAVEフォーマットのオーディオデータ取得 + * \param mvply : CRI Movie ハンドル + * \param nch : チャネル数 + * \param waveptr : オーディオデータバッファ + * \param wavesmpl : 要求サンプル数(<バッファサイズ) + * \param waveinfo : 16bit Waveform 情報 + * \return 取得できたサンプル数 + * \par 説明: + * 16bitのWAVEフォーマットでオーディオデータを取得します。引数waveptrには、nch分のバッファポインタを格納した + * 配列を指定してください。
+ * 引数CriMvWaveInfo構造体には、取得したオーディオデータについての情報が格納されます。
+ * 入力データ不足などで要求されたサンプル数のデコードができない場合もあります。
+ * (未実装機能) 本関数の処理が重くなってでも、なるべく要求された多くのオーディオデータを取得するモード。 + */ +/* + * \ingroup MODULE_AUDIO + * \brief Get 16bit wave audio data + * \param mvply A currently playing CriMvPly handle + * \param nch The number of audio channels to get in this call + * \param waveptr An array of audio data buffers to copy audio data into + * \param wavesmpl The number of requested wave data samples (must be less than buffer size) + * \param waveinfo A structure filled by this function with info about this wave + * \return The number of wave data samples actually copied into the buffer + * + * This function copies currently decoding audio data into your output buffer + * for you to send to the audio output. The output format is a sixteen-bit PCM + * format. The data provided is "current", e.g. you should try to minimize latency. + * while delivering the audio data to the output device. + * + * This function will return an empty audio buffer if the input to the CriMvPly + * handle is starving for data, or if criMvPly_Execute() or criMvPly_ExecuteAll() + * has not been called recently. + * + * Note that this function actually copies data. However, the expected bandwidth + * for moving audio data in memory is minimal -- about 176400 bytes per second for + * a stereo stream, which is typically a fraction of 1% of the bandwidth available + * on modern game systems. + * + * For debugging tips on stuttering, see \ref crim_section_stuttering . + */ +CriUint32 CRIAPI criMvPly_GetWave16(CriMvPly mvply, CriUint32 nch, CriSint16 *waveptr[], + CriUint32 wavesmpl, CriMvWaveInfo *waveinfo); +CriUint32 CRIAPI criMvPly_GetWave32(CriMvPly mvply, CriUint32 nch, CriFloat32 *waveptr[], + CriUint32 wavesmpl, CriMvWaveInfo *waveinfo); + + +#if defined(XPT_TGT_EE) +/* スクラッチパッドRAM使用設定 */ +/* スクラッチパッドRAMの使用設定(ハンドル作成前に呼び出すこと) */ +/* + * \brief スクラッチパッドRAM使用設定 + * \param sw : + * \return なし + * \par 説明: + * スクラッチパッドRAMの使用設定を行います。
+ * デフォルトはOFFです。 + */ +/* + * \if ps2 + * \ingroup MODULE_INIT + * \brief Enable or disable PS2 scratch pad (SPRAM) usage + * \param sw : ON to enable scratch pad use, OFF to disable + * + * This function determines whether the video decode step uses the PS2 + * SPRAM memory area for its work. The performance of this library is + * increased by around 30% when using SPRAM; however, this use might + * conflict with graphics engines that depend on exclusive access to SPRAM. + * However, on the PS2, the video decode step occurs synchronously to the + * criMvPly_GetFrameRGBA32_PS2() function, so you can take appropriate external + * locking measures to intelligently synchronize SPRAM utilization. + * The value set by criMvPly_SetUseScratchPadRAM_PS2() is internally checked + * exactly once, during the criMvPly_Create() step; calling this function + * after criMvPly_Create() has no effect. The default setting for this + * function is OFF. + * \endif + */ +void CRIAPI criMvPly_SetUseScratchPadRAM_PS2(CriBool sw); +#endif + + +/* メモリからの再生開始 */ +/* + * \brief メモリからの再生開始 + * \param mvply : CRI Movie ハンドル + * \param memptr : メモリ上のムービデータの先頭アドレス + * \param memsize : メモリ上のムービデータのサイズ + * \return なし + * \par 説明: + * メモリからのムービ再生を開始します。
+ * 本関数の呼び出し前に、あらかじめムービデータの全てをメモリ上に読み込んでおいてください。 + */ +/* + * \ingroup MODULE_STATE + * \brief Start playback from movie file on memory + * \param mvply A currently playing CriMvPly handle + * \param memptr A address of movie file + * \param memsize The size of movie file + * + * Start playback from memory.
+ * Please read movie file to memory before playback. + */ +void CRIAPI criMvPly_StartMemory(CriMvPly mvply, CriUint8* memptr, CriUint32 memsize); + + +/* + * YUV個別バッファへのフレーム取得 + */ +/* + * \if xbox360 + * \ingroup MODULE_VIDEO + * \brief Get a video frame to Y,U,V independently texture buffers + * \param mvply A valid CriMvPly handle + * \param yuvbuffers Information about Y,U,V independently texture buffers + * \param frameinfo Information about the decoded frame + * \return returns true if a frame has been copied into the buffer, false otherwise + * + * This function finds and decodes the current frame, if any, to the Y,U,V texture buffers. + * This function will only return a valid frame if the CriMvPly handle is in the + * CRIMVPLY_STATUS_WAIT_PLAYING or the CRIMVPLY_STATUS_PLAYING state. + * \endif + */ +CriBool CRIAPI criMvPly_GetFrameYUVBuffers(CriMvPly mvply, CriMvYuvBuffers *yuvbuffers, CriMvFrameInfo *frameinfo); + + +/* + * ビデオのデコード + */ +/* + * \ingroup MODULE_VIDEO + * \param mvply The movie player handle + * \return returns the number of decoded frames + * + */ +CriUint32 CRIAPI criMvPly_DecodeVideo(CriMvPly mvply); + +/* + * ヘッダのデコード + */ +/* + * + * \ingroup MODULE_VIDEO + * \param mvply The movie player handle + * + */ +void CRIAPI criMvPly_DecodeHeader(CriMvPly mvply); + +/* + * デコードスキップ指示 + * \par 説明: + * この関数を実行した回数だけ、その後のデコード時に自動的に1枚Bピクチャをスキップする。
+ * スキップ指示を出した次のフレームからは、実際のスキップが実行されていなくても + * 表示時刻はスキップしたものとして補正される。 + */ +/* + * \ingroup MODULE_VIDEO + * \param mvply The movie player handle + * \return returns the number of decoded frames + * + * After calling SkipFrame function, Decoding function skip B-picture. + * To avoid that application judge continuous wrong skip, After calling + * SkipFrame function, next frame time will be adjusted. + */ +void CRIAPI criMvPly_SkipFrame(CriMvPly mvply); + + +#if 0 +/* + * YUVA8フォーマットのフレーム取得 + */ +/* + * \if ps3 + * \ingroup MODULE_VIDEO + * \brief Get a video frame in YUVA8 format. + * \param mvply A valid CriMvPly handle + * \param imagebuf A pointer to the video buffer in memory to receive the frame + * \param pitch Number of bytes in one row of the video buffer + * \param bufsize Video buffer size in bytes + * \param frameinfo Information about the decoded frame + * \return returns true if a frame has been copied into the buffer, false otherwise + * + * This function finds and decodes the current frame, if any, to the imagebuf buffer. + * This function will only return a valid frame if the CriMvPly handle is in the + * CRIMVPLY_STATUS_WAIT_PLAYING or the CRIMVPLY_STATUS_PLAYING state. + * \endif + */ +CriBool CRIAPI criMvPly_GetFrameYUVA8_PS3(CriMvPly mvply, CriUint8 *imagebuf, CriUint32 pitch, CriUint32 bufsize, CriMvFrameInfo *frameinfo); +#endif + +/* + * ARGB8888フォーマットでフレーム取得 + */ +/* + * \if ps3 + * \ingroup MODULE_VIDEO + * \brief Get a video frame in ARGB8888 format. + * \param mvply A valid CriMvPly handle + * \param imagebuf A pointer to the video buffer in memory to receive the frame + * \param pitch Number of bytes in one row of the video buffer + * \param bufsize Video buffer size in bytes + * \param frameinfo Information about the decoded frame + * \return returns true if a frame has been copied into the buffer, false otherwise + * + * This function finds and decodes the current frame, if any, to the imagebuf buffer. + * This function will only return a valid frame if the CriMvPly handle is in the + * CRIMVPLY_STATUS_WAIT_PLAYING or the CRIMVPLY_STATUS_PLAYING state. + * \endif + */ +CriBool CRIAPI criMvPly_GetFrameARGB8888(CriMvPly mvply, CriUint8 *imagebuf, CriUint32 pitch, CriUint32 bufsize, CriMvFrameInfo *frameinfo); +void CRIAPI criMvPly_InitializeFrameARGB8888(void); + + +#if defined(XPT_TGT_IPHONE) || defined(XPT_TGT_WINMO) || defined(XPT_TGT_ANDROID) || defined(XPT_TGT_CQSH2A) || defined(XPT_TGT_ACRODEA) || defined(XPT_TGT_NACL) || defined(XPT_TGT_SH7269) || defined(XPT_TGT_TRGP6K) +/* + * RGB565フォーマットでフレーム取得 + */ +/* + * \ingroup MODULE_VIDEO + * \brief Get a video frame in RGB565 format + */ +CriBool CRIAPI criMvPly_GetFrameRGB565(CriMvPly mvply, CriUint8 *imagebuf, CriUint32 pitch, CriUint32 bufsize, CriMvFrameInfo *frameinfo); +void CRIAPI criMvPly_InitializeFrameRGB565(void); +#endif + +/* + * 次のフレームの情報だけ取得する + */ +/* + * \ingroup MODULE_VIDEO + * \brief Get a information of next video frame (without actual video frame). + */ +CriUint8* CRIAPI criMvPly_GetNextFrameInfo(CriMvPly mvply, CriMvFrameInfo *frameinfo); + +/* + * 次のフレームを捨てる + */ +CriBool CRIAPI criMvPly_DiscardNextFrame(CriMvPly mvply, CriMvFrameInfo *frameinfo); + +/* + * 再生準備完了状態(PREPからWAIT_PLAYING)になるまでに貯金するフレーム数の指定 + * この関数を呼び出さなければ、貯金フレーム数 = フレームプール数 + */ +void CRIAPI criMvPly_SetNumberOfFramesForPrep(CriMvPly mvply, CriSint32 nframes); + +/* + * For Debug use. + */ +void CRIAPI criMvPly_SetSeekPosition(CriMvPly mvply, CriSint32 seek_frame_id, CriSint32 video_gop_top_id); +void CRIAPI criMvPly_SetSeekAlphaPosition(CriMvPly mvply, CriSint32 alpha_gop_top_id); +void CRIAPI criMvPly_CalcSeekPosition(CriMvPly mvply, void *seektbl_ptr, CriUint32 seektbl_size, Sint32 frame_id, Uint64 *offset, Sint32 *gop_top_id); + +/* for specific use */ +/* ボディアドレスの設定 */ +void CRIAPI criMvPly_SetBodyData(CriMvPly mvply, const CriUint64Adr body_ptr, CriSint64 body_size); + +/* 入力SJおよびバッファサイズの取得(バッファサイズ、リロードサイズはNULL指定で省略) */ +CriSj CRIAPI criMvPly_GetInputSj(CriMvPly mvply, CriUint32 *buffer_size, CriUint32 *reload_threshold); + +/* 名前&タイプ指定によるイベントポイント情報の取得 */ +//Bool criMvPly_SearchEventPointByName(CriMvPly mvply, Char8 *cue_name, Sint32 type, CriMvEventPoint *eventinfo); +/* イベントポイント情報からフレームIDへの変換 */ +//Sint32 criMvPly_CalcFrameIdFromCuePoint(CriMvPly mvply, CriMvEventPoint *eventinfo); + +CriBool CRIAPI criMvPly_AttachSubAudio(CriMvPly mvply, CriHeap heap, CriUint32 track); +CriUint32 CRIAPI criMvPly_GetSubAudioWave16(CriMvPly mvply, CriUint32 nch, CriSint16 *waveptr[], CriUint32 wavesmpl, CriMvWaveInfo *waveinfo); +CriUint32 CRIAPI criMvPly_GetSubAudioWave32(CriMvPly mvply, CriUint32 nch, CriFloat32 *waveptr[], CriUint32 wavesmpl, CriMvWaveInfo *waveinfo); +void CRIAPI criMvPly_DetachSubAudio(CriMvPly mvply); + +void CRIAPI criMvPly_GetSubtitle(CriMvPly mvply, CriUint8 *bufptr, CriUint32 bufsize, CriMvSubtitleInfo *info); +void CRIAPI criMvPly_GetNextSubtitleInfo(CriMvPly mvply, CriMvSubtitleInfo *info); + +/* 入力バッファのデータ量を見る[byte] */ +CriUint32 CRIAPI criMvPly_PeekInputBufferData(CriMvPly mvply); +/* メモリ上のムービを入力SJに追加する */ +void CRIAPI criMvPly_AddInputMemory(CriMvPly mvply, CriUint8* memptr, CriUint32 memsize); + + +/* 取得できるオーディオデータのサンプル数を調べる */ +CriUint32 CRIAPI criMvPly_GetDataSizeMainAudio(CriMvPly mvply, CriUint32 nch); +/* 取得できるオーディオデータのサンプル数を調べる */ +CriUint32 CRIAPI criMvPly_GetDataSizeSubAudio(CriMvPly mvply, CriUint32 nch); + +/* メインのオーディオの再生が終了しているかどうかを調べる */ +CriBool CRIAPI criMvPly_IsEndMainAudioPlayback(CriMvPly mvply); +/* サブのオーディオの再生が終了しているかどうかを調べる */ +CriBool CRIAPI criMvPly_IsEndSubAudioPlayback(CriMvPly mvply); + +/* メインオーディオが活動中かどうかを調べる (デコード中かつ出力バッファがある状態) */ +CriBool CRIAPI criMvPly_IsActiveMainAudioPlayback(CriMvPly mvply); + +/* ワーク確保前に設定変更すること */ +void CRIAPI criMvPly_SetPcmFormat(CriMvPly mvply, CriMvPcmFormat pcmfmt); + +#if defined(XPT_TGT_PC) +/* [PC] マルチプロセッサの指定 */ +//void CRIAPI criMvPly_SetProcessorParameters_PC(CriMvPly mvply, Sint32 thread_num, Uint32 *affinity_masks, Sint32 *priorities); +#endif + +#if defined(XPT_TGT_XBOX360) +/* [Xbox360] マルチプロセッサの指定 */ +void CRIAPI criMvPly_SetProcessorParameters_XBOX360(CriMvPly mvply, Sint32 thread_num, CriUint32 processor_mask, CriSint32 *priorities); +#endif + +#if defined(XPT_TGT_PS3PPU) +/* [PS3] SPURSの指定 */ +void CRIAPI criMvPly_SetupSpursParameters_PS3(const CriMvProcessorParameters_PS3 *processor_param); + /* [PS3] SPUスレッドによるマルチプロセッサの指定 */ +void CRIAPI criMvPly_SetupSpuThreadParameters_PS3(const CriMvSpuThreadParameters_PS3 *spu_thread_param); +void CRIAPI criMvPly_SetGraphicEnv(CriMvGraphicEnv env); +CriMvGraphicEnv CRIAPI criMvPly_GetGraphicEnv(void); +#endif + +/* フレームプール情報の取得 */ +void CRIAPI criMvPly_GetFramePoolInfo(CriMvPly mvply, CriSint32 *num_input, CriUint32* num_data, CriUint32* num_ref, CriUint32* num_hold, CriUint32* num_free); + +/* 再生中でも字幕チャネルを切り替える */ +void CRIAPI criMvPly_SetSubtitleChannel(CriMvPly mvply, CriSint32 chno); + +/* ポインタだけ取得してフレームプール内のバッファをロックする */ +CriBool CRIAPI criMvPly_LockFrameBuffer(CriMvPly mvply, CriMvYuvBuffers *yuvbuffers, CriMvFrameInfo *frameinfo); +/* ロックしていたフレームプールを解放する */ +CriBool CRIAPI criMvPly_UnlockFrameBuffer(CriMvPly mvply, CriMvFrameInfo *frameinfo); + +/* + * For Sofdec2 + */ +CriMvPly CRIAPI criMvPly_CreateWithWork(void *work, CriSint32 size, CriMvHandleConfig *config); +CriSint32 CRIAPI criMvPly_CalcHandleWorkSize(CriMvHandleConfig *config); +CriSint32 CRIAPI criMvPly_CalcPlaybackWorkSize(CriMvPly mvply, CriMvStreamingParameters *stmprm); +CriBool CRIAPI criMvPly_AllocateWorkBufferWithWork(CriMvPly mvply, void *work ,Sint32 work_size, CriMvStreamingParameters *stmprm); +void CRIAPI criMvPly_SetMetaDataWorkAllocator(CriMvPly mvply, CriMvMetaDataWorkMallocFunc allocfunc, CriMvMetaDataWorkFreeFunc freefunc, void *usrobj, CriMvMetaFlag meta_flag); +CriSint32 criMvPly_CalcSubAudioWorkSize(CriMvPly mvply, const CriMvAudioParameters *aprm); +CriBool criMvPly_CopyFrameYUVBuffers(CriMvPly mvply, CriMvYuvBuffers *yuvbuffers, + const CriMvFrameInfo *frameinfo,const CriMvAlphaFrameInfo *alpha_frameinfo); +CriBool criMvPly_CopyFrameARGB8888Buffer(CriMvPly mvply, CriUint8 *dst_buf, CriUint32 dst_pitch, CriUint32 dst_bufsize, + const CriMvYuvBuffers *src_bufs, const CriMvFrameInfo *src_vinf, const CriMvAlphaFrameInfo *src_ainf); +#if defined(XPT_TGT_IPHONE) || defined(XPT_TGT_WINMO) || defined(XPT_TGT_ANDROID) || defined(XPT_TGT_CQSH2A) || defined(XPT_TGT_ACRODEA) || defined(XPT_TGT_NACL) || defined(XPT_TGT_SH7269) || defined(XPT_TGT_TRGP6K) || defined(XPT_TGT_TRGP6K) +CriBool criMvPly_CopyFrameRGB565Buffer(CriMvPly mvply, CriUint8 *dst_buf, CriUint32 dst_pitch, CriUint32 dst_bufsize, + const CriMvYuvBuffers *src_bufs, const CriMvFrameInfo *src_vinf, const CriMvAlphaFrameInfo *src_ainf); +#endif +CriBool criMvPly_LockAlphaFrameBuffer(CriMvPly mvply, CriMvYuvBuffers *yuvbuffers, CriMvAlphaFrameInfo *alpha_frameinfo); +CriBool criMvPly_UnlockAlphaFrameBuffer(CriMvPly mvply, CriMvAlphaFrameInfo *alpha_frameinfo); +CriSint32 criMvPly_GetNumPictureData(CriMvPly mvply); +const CriMvPlyHeaderInfo* criMvPly_GetCurrentStreamInfo(CriMvPly mvply); +/* for debug */ +CriBool CRIAPI criMvPly_GetAlphaFrame(CriMvPly mvply, CriUint8 *imagebuf, CriUint32 pitch, CriMvAlphaFrameInfo *alpha_frameinfo); + +/* OUTER_FRAMEPOOL_WORK */ +/* フレームプール用ワーク計算。ハンドルはNULL指定OK。 */ +CriSint32 criMvPly_CalcFramepoolWorkSize(CriMvPly mvply, const CriMvStreamingParameters *stmprm); +/* フレームプール用ワーク設定 */ +void criMvPly_SetFramepoolWork(CriMvPly mvply, void *work, CriSint32 work_size); +/* フレームプール用ワークアロケータ設定 */ +void criMvPly_SetFramepoolWorkAllocator(CriMvPly mvply, CriMvFramepoolWorkMallocFunc allocfunc, CriMvFramepoolWorkFreeFunc freefunc, void *usrobj); + +/* シークブロック情報の取得 */ +/* <入力> + * - seektbl_ptr : UTFアドレス + * - seektbl_size : UTFサイズ + * - num_seekblock : 出力配列の要素数 + * <出力> + * - blockinfo : シークブロック情報配列へのポインタ(num_seekblock分の領域を確保して渡すこと) + */ +void criMvPly_GetSeekBlockInfo(CriMvPly mvply, void *seektbl_ptr, CriUint32 seektbl_size, CriSint32 num_seekblock, CriMvSeekBlockInfo *blockinfo); + +/* フレームレートの強制指定 */ +void criMvPly_SetVideoFramerate(CriMvPly mvply, CriUint32 framerate_n, CriUint32 framerate_d); + +/* 同期有無の設定 */ +void criMvPly_SetSyncFlag(CriMvPly mvply, CriBool sync_flag); + +/* 再生可能かの問い合わせ */ +CriBool criMvPly_IsPlayable(CriMvPly mvply, const CriMvStreamingParameters *stmprm); + + + +#ifdef __cplusplus +} +#endif + +#endif /* CRI_MOVIE_CORE_H_INCLUDED */ diff --git a/3rdParty/cri/pc/include/cri_movie_pc.h b/3rdParty/cri/pc/include/cri_movie_pc.h new file mode 100644 index 00000000..4b2443d0 --- /dev/null +++ b/3rdParty/cri/pc/include/cri_movie_pc.h @@ -0,0 +1,96 @@ +/**************************************************************************** + * + * CRI Middleware SDK + * + * Copyright (c) 2013 CRI Middleware Co., Ltd. + * + * Library : CRI Movie + * Module : Library User's Header + * File : cri_movie_pc.h + * Date : 2013-11-26 + * + ****************************************************************************/ +/*! + * \file cri_movie_pc.h + */ +#ifndef CRI_MOVIE_PC_H_INCLUDED /* Re-definition prevention */ +#define CRI_MOVIE_PC_H_INCLUDED + +/*************************************************************************** + * Include file + ***************************************************************************/ +#include + +#include +#include + +/*************************************************************************** + * Variable Declaration + ***************************************************************************/ +namespace CriMv { + extern CriError ErrorContainer; +} + +/*************************************************************************** + * Prototype Functions + ***************************************************************************/ +namespace CriMv { + /*EN + * \ingroup MODULE_OPTION + * \brief Set processor parameters for decoding on PC (Library Global) + * + * \param num_threads Number of additional threads for load distribution in decoding (Maximum 7 threads) + * \param affinity_masks Pointer to an array of thread affinity masks for each thread specified with num_threads. + * \param priorities Pointer to an array of thread priority for each thread specified with num_threads. + * \param err Optional error code + * + * This function sets the processor parameters for decoding as default setting of library global. + * Use it when you want to change processors or thread priority for decoding load distribution. + * + * If this function is called, it must be called before library initialization. + * + * On initialization, CRI Movie prepares 7 worker threads for distributed decoding.
+ * + * \a num_threads specifies how many worker threads CRI Movie should use.
+ * \a affinity_mask is an array of affinity masks for the worker threads. This array must have + * \a num_threads many elements. The format of \a affinity_mask is same as for the value passed to the + * Win32 SetThreadAffinityMask() API function.
+ * \a priorities is an array of thread priority for the worker threads. This array must have + * \a num_threads many elements. The format of \a priorities is same as for the value passed to the + * Win32 SetThreadPriority() API function.
+ * + * If this function is not called, 7 distributed decoding threads will run in parallel by default. + * Also, processor assignment of the decoding threads is handled by the operating system, and their + * priority will be normal. + */ + /*JP + * \ingroup MODULE_OPTION + * \brief PCでデコード処理に使う追加プロセッサ設定(ライブラリ全体) + * \param num_threads 負荷分散デコード用に使用する追加スレッドの数 (最大7つ) + * \param affinity_masks スレッドアフィニティマスクの配列へのポインタ。num_threadsで指定したスレッドごとのマスク値。 + * \param priorities 追加スレッドの優先度配列へのポインタ。 + * \param err エラー情報(省略可) + * + * デコード処理を分散して処理するためのプロセッサをライブラリ全体に指定します。 + * デコード処理に行うプロセッサやスレッド優先度を変更したい場合に使用してください。 + * 本関数はライブラリ初期化前に呼び出す必要があります。 + * + * CRI Movieは初期化の際に7つの分散デコード用のワーカースレッドを用意します。 + * num_threads引数で、そのうちのいくつのスレッドを実際に使用するかを指定できます。 + * アプリケーションから明示的にプロセッサ割り当てを行いたい場合、個々のスレッドに対して + * アフィニティマスクとスレッド優先度を設定してください。 + * アフィニティマスクの値は、Win32 APIのSetThreadAffinityMaskの引数と同じ書式です。 + * スレッド優先度は、Win32 APIのSetThreadPriorityの引数と同じ書式です。 + * + * この関数を呼ばなかった場合、7つのスレッドで並列デコードを行います。 + * デコードスレッドのプロセッサは割り当ては全てOS任せで、優先度はスレッド標準になります。 + */ + void SetUsableProcessors_PC( + CriSint32 num_threads, + const DWORD_PTR *affinity_masks, + const int *priorities, + CriError &err = CriMv::ErrorContainer); +} + + +#endif /* CRI_MOVIE_PC_H_INCLUDED */ diff --git a/3rdParty/cri/pc/include/cri_sj.h b/3rdParty/cri/pc/include/cri_sj.h new file mode 100644 index 00000000..045a121c --- /dev/null +++ b/3rdParty/cri/pc/include/cri_sj.h @@ -0,0 +1,189 @@ +/**************************************************************************** + * + * CRI Middleware SDK + * + * Copyright (c) 2006-2010 CRI Middleware Co., Ltd. + * + ****************************************************************************/ + +#ifndef _CRI_SJ_H_INCLUDED +#define _CRI_SJ_H_INCLUDED +/**************************************************************************** + * * + * CRI Stream Joint "CriSj" Library * + * * + * 2005-06-21 written by M.Oshimi * + * * + ****************************************************************************/ + +/**************************************************************************** + * Include file * + ****************************************************************************/ +#include "cri_xpt.h" +#include "cri_heap.h" + +/**************************************************************************** + * MACRO CONSTANT * + ****************************************************************************/ + +/* Version number of CriSj */ +#define CRISJ_NAME_STRINGS "CRI Stream Joint" +#define CRISJ_VERSION_STRINGS "1.01.00" + +#define CRISJUNI_MAX_LINE (4) +#define CRICHUNK_MAX_SIZE (0xffffffff) + +/*********************************************************************** + * Process MACRO + ***********************************************************************/ + +/**************************************************************************** + * Data type declaration * + ****************************************************************************/ + +/* ストリームライン */ +typedef enum { + CRISJ_LINE_FREE = (0), + CRISJ_LINE_DATA = (1), + CRISJ_LINE_HOLD = (2), + CRISJ_LINE_EXTRA = (3), + /* enum be 4bytes */ + CRISJ_LINE_ENUM_BE_SINT32 = 0x7FFFFFFF +} CriSjLine; + +/* チャンク */ +#ifndef TYPEDEF_CRICHUNK +#define TYPEDEF_CRICHUNK +typedef struct { + CriUint8 *data; /* データ */ + CriUint32 size; /* バイト数 */ +} CriChunk; +#endif + +/* CriSjハンドル */ +/* CriSj handle */ +typedef struct { + struct _crisj_function_table *vtbl; + const CriChar8 *name; +} CriSjObj, *CriSj; + +typedef struct _crisj_function_table { + /* ハンドルの消去 */ + void (*Destroy)(CriSj sj); + /* リセット */ + void (*Reset)(CriSj sj); + /* チャンクの取得 (FIFOの先頭から取得) */ + void (*GetChunk)(CriSj sj, CriSjLine id, CriUint32 nbyte, CriChunk *ck); + /* チャンクを戻す (FIFOの先頭に挿入) */ + void (*UngetChunk)(CriSj sj, CriSjLine id, CriChunk *ck); + /* チャンクを挿入 (FIFOの最後に挿入) */ + void (*PutChunk)(CriSj sj, CriSjLine id, CriChunk *ck); + /* ラインから取得できる総バイト数の取得 */ + CriUint32 (*GetTotalSize)(CriSj sj, CriSjLine id); +} CriSjVirtualFunctionTable; + +typedef enum { + CRISJ_UNIMODE_SEPARATE = (0), + CRISJ_UNIMODE_JOIN = (1), + /* enum be 4bytes */ + CRISJ_UNIMODE_ENUM_BE_SINT32 = 0x7FFFFFFF +} CriSjUniversalMode; + + +typedef struct CriSjRbfConfig { + CriBool use_cs; + CriUint32 buffer_size; + CriUint32 extra_size; + CriUint32 alignment; + const CriChar8 *buffer_name; +} CriSjRbfConfig; + +typedef struct CriSjMemConfig { + CriBool use_cs; + CriUint8 *data; + CriUint32 data_size; +} CriSjMemConfig; + +typedef struct CriSjUniConfig { + CriBool use_cs; + CriSjUniversalMode mode; + CriUint32 num_chunks; +} CriSjUniConfig; + +/**************************************************************************** + * Function Declaration * + ****************************************************************************/ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +/* リングバッファ型SJの作成 */ +CriSint32 CRIAPI criSjRbf_CalculateWorkSize(const CriSjRbfConfig* config); +CriSj CRIAPI criSjRbf_Create(const CriSjRbfConfig *config, void *work, CriSint32 work_size); +CriSj CRIAPI criSjRbf_CreateByHeap(const CriSjRbfConfig *config, CriHeap heap, CriHeapType heap_type); + +/* 常駐メモリ型SJの作成 */ +CriSint32 CRIAPI criSjMem_CalculateWorkSize(const CriSjMemConfig* config); +CriSj CRIAPI criSjMem_Create(const CriSjMemConfig *config, void *work, CriSint32 work_size); +CriSj CRIAPI criSjMem_CreateByHeap(const CriSjMemConfig *config, CriHeap heap, CriHeapType heap_type); + +/* ユニバーサルSJの作成 */ +CriSint32 CRIAPI criSjUni_CalculateWorkSize(const CriSjUniConfig* config); +CriSj CRIAPI criSjUni_Create(const CriSjUniConfig *config, void *work, CriSint32 work_size); +CriSj CRIAPI criSjUni_CreateByHeap(const CriSjUniConfig *config, CriHeap heap, CriHeapType heap_type); +/* チェインプール数の取得 */ +CriSint32 CRIAPI criSjUni_GetNumChainPool(CriSj sj); + +void CRIAPI criSj_Destroy(CriSj sj); +void CRIAPI criSj_Reset(CriSj sj); +void CRIAPI criSj_GetChunk(CriSj sj, CriSjLine line, CriUint32 nbyte, CriChunk *ck); +void CRIAPI criSj_UngetChunk(CriSj sj, CriSjLine line, CriChunk *ck); +void CRIAPI criSj_PutChunk(CriSj sj, CriSjLine line, CriChunk *ck); +CriUint32 CRIAPI criSj_GetTotalSize(CriSj sj, CriSjLine line); +void CRIAPI criSj_SplitChunk(CriChunk *ck, CriUint32 nbyte, CriChunk *ck1, CriChunk *ck2); + +/*** +* New APIs +***/ + +CriUint32 CRIAPI criSj_GetInputFreeSize(CriSj sj); +void CRIAPI criSj_GetInputChunk(CriSj sj, CriChunk *ck); +void CRIAPI criSj_PutInputChunk(CriSj sj, CriChunk *ck, CriUint32 input_size); +CriUint32 CRIAPI criSj_GetOutputDataSize(CriSj sj); +void CRIAPI criSj_GetOutputChunk(CriSj sj, CriChunk *ck); +void CRIAPI criSj_PutOutputChunk(CriSj sj, CriChunk *ck, CriUint32 output_size); + +CriUint32 CRIAPI criSj_PutOutputChunk2(CriSj sj, CriChunk *ck1, CriChunk *ck2, CriUint32 output_size); + + +/*** +* Old Interface (for compatibility) +***/ +typedef struct _CriSjConfig { + CriBool use_cs; + CriHeapType heap_type; +} CriSjConfig; + +CriSj CRIAPI criSj_CreateRingBuffer(CriHeap heap, CriUint32 bsize, CriUint32 xsize, CriUint32 align); +CriSj CRIAPI criSj_CreateNamedRingBuffer(CriHeap heap, CriUint32 bsize, CriUint32 xsize, CriUint32 align, const CriChar8 *bname); +CriSj CRIAPI criSj_CreateRingBufferWithConfig(CriHeap heap, CriUint32 bsize, CriUint32 xsize, CriUint32 align, const CriSjConfig *config); +CriSj CRIAPI criSj_CreateNamedRingBufferWithConfig(CriHeap heap, CriUint32 bsize, CriUint32 xsize, CriUint32 align, const CriChar8 *bname, const CriSjConfig *config); +CriSint32 CRIAPI criSjRbf_GetRequiredMemorySizeWithConfig(CriUint32 bsize, CriUint32 xsize, CriUint32 align, const CriSjConfig *config); + +CriSj CRIAPI criSj_CreateMemory(CriHeap heap, CriUint8 *data, CriUint32 dtsize, CriUint32 align); +CriSj CRIAPI criSj_CreateMemoryWithConfig(CriHeap heap, CriUint8 *data, CriUint32 dtsize, CriUint32 align, const CriSjConfig *config); +CriSint32 CRIAPI criSjMem_GetRequiredMemorySizeWithConfig(CriUint32 align, const CriSjConfig *config); + +CriSj CRIAPI criSj_CreateUniversal(CriHeap heap, CriSjUniversalMode mode, CriUint32 nchunk); +CriSj CRIAPI criSj_CreateUniversalWithConfig(CriHeap heap, CriSjUniversalMode mode, CriUint32 nchunk, const CriSjConfig *config); +CriSint32 CRIAPI criSjUni_GetRequiredMemorySizeWithConfig(CriSjUniversalMode mode, CriUint32 nchunk, const CriSjConfig *config); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + + +#endif + +/* end of file */ diff --git a/3rdParty/cri/pc/include/cri_xpt.h b/3rdParty/cri/pc/include/cri_xpt.h new file mode 100644 index 00000000..80411aa8 --- /dev/null +++ b/3rdParty/cri/pc/include/cri_xpt.h @@ -0,0 +1,51 @@ +/**************************************************************************** + * + * CRI Middleware SDK + * + * Copyright (c) 1998-2010 CRI Middleware Co., Ltd. + * + * Library : CRI Middleware Library + * Module : CRI Common Header for Windows + * File : cri_xpt.h + * Date : 2010-05-19 + * Version : 1.17 + * + ****************************************************************************/ +#ifndef CRI_INCL_CRI_XPT_H +#define CRI_INCL_CRI_XPT_H + +#if defined(__BORLANDC__) +#define XPT_TGT_BCB +#else +#define XPT_TGT_PC +#define XPT_TGT_PC_PRO +#endif + +#define XPT_CCS_LEND +#define XPT_SUPPORT_MULTICHANNEL + +#if defined(XPT_TGT_PC) + #if defined(_MSC_VER) + #if (_MSC_VER >= 1400) /* Visual Studio 2005 or later */ + #if defined(WIN64) || defined(_WIN64) || defined(_M_X64) + #define CRI_TARGET_STR "PCx64" /* WIN64 */ + #elif defined(WIN32) || defined(_WIN32) + #define CRI_TARGET_STR "PCx86" /* WIN32 */ + #else + #error cri_xpt.h : Preprosessor definition WIN32/WIN64 should be defined. + #endif + #else + #define CRI_TARGET_STR "PC" /* Visual Studio .NET 2003 or Visual C++ 6.0 */ + #endif + #else + #error cri_xpt.h : CRI_TARGET_STR is not defined by reason that the compiler is not assumed. + #endif +#else + #define CRI_TARGET_STR "PCBCB" +#endif + +#include "cri_xpts_win.h" +#include "cri_xpt_post.h" + +#endif /* CRI_INCL_CRI_XPT_H */ +/* End Of File */ diff --git a/3rdParty/cri/pc/include/cri_xpt_post.h b/3rdParty/cri/pc/include/cri_xpt_post.h new file mode 100644 index 00000000..89413936 --- /dev/null +++ b/3rdParty/cri/pc/include/cri_xpt_post.h @@ -0,0 +1,256 @@ +/***************************************************************************** + * + * CRI Middleware SDK + * + * Copyright (c) 1998-2012 CRI Middleware Co., Ltd. + * + * Library : CRI Middleware Library + * Module : CRI Common Header / Post-Process + * File : cri_xpt_post.h + * Date : 2012-05-15 + * Version : 2.07 + * + *****************************************************************************/ +#ifndef CRI_INCL_CRI_XPT_POST_H +#define CRI_INCL_CRI_XPT_POST_H + + +/***************************************************************************** + * マクロ定義 + * Macro definition + *****************************************************************************/ + +/* コンパイル時の静的アサート + * C++ BoostのSTATIC_ASSERTと同等の機能をC言語で実装する。 + * 条件が真であることを検証する。偽の場合はコンパイルエラーを起こして、コン + * パイルを停止させる。 + * Static Asart when compiling + * This function is equal to STATIC_ASSERT of C++ Boost, and is imprementated + * by C language. If the condition is false, a compiler error is caused and + * it stop compiling. + */ +#define XPT_STATIC_ASSERT(cond) extern int xpt_static_assert_array[(cond)?1:-1] + + +/***************************************************************************** + * コンパイルオプションの検証 + * Compiler option test + *****************************************************************************/ + +/* enum型の検証 + *  enum型がint型に整合することを検証する。 + *  適切なエラーメッセージを表示したいので、可能ならコンパイルオプションによる + *  チェックを行う。不可能な場合、汎用的な静的アサートによるチェックが働く。 + * Enum type test + * It is verified that the enum type adjusts to the int type. + * To display an appropriate error message, it checks the compiler option + * if possible. General static asart test works if it is impossible. + */ +#if defined(__MWERKS__) /* CodeWarrior */ + //#if !__option(enumsalwaysint) + // #error ERROR cri_xpt_post.h : Compiler option 'Enums Always Int' should be ON. + //#endif +#elif defined(__GNUC__) + //#if Compiler option -fshort-enums is used + // #error ERROR cri_xpt_post.h : Compiler option '-fshort-enums' should not be used. + //#endif +#endif +//typedef enum {XPT_TEST_ENUM_0, XPT_TEST_ENUM_1, XPT_TEST_ENUM_2} XptTestEnum; +//XPT_STATIC_ASSERT(sizeof(XptTestEnum) == sizeof(Uint32)); /* enum should be 4byte. */ + +/***************************************************************************** + * 定数マクロ + * Macros of constant value + *****************************************************************************/ + +/* NULL ポインタ型 */ +#if !defined(CRI_NULL) +#ifdef __cplusplus +#define CRI_NULL (0) +#else +#define CRI_NULL ((void *)0) +#endif +#endif + +/* 論理定数1(偽、真) */ +#if !defined(CRI_FALSE) +#define CRI_FALSE (0) +#endif +#if !defined(CRI_TRUE) +#define CRI_TRUE (1) +#endif + +/* 論理定数2(スイッチ) */ +#if !defined(CRI_OFF) +#define CRI_OFF (0) +#endif +#if !defined(CRI_ON) +#define CRI_ON (1) +#endif + +/* 結果判定の定数(成功、失敗) */ +#if !defined(CRI_OK) +#define CRI_OK (0) /* 成功 */ +#endif +#if !defined(CRI_NG) +#define CRI_NG (-1) /* 失敗 */ +#endif + +/***************************************************************************** + * ポインタまたは64ビットアドレスを格納できる整数型 + * 備考: ポインタ32bitかつROMアドレス空間64bitの環境で、両者を透過的に扱える。 + * The integer type which can hold an pointer or an address up to 64 bits. + * NOTE: In the environment of pointer 32bit and ROM address space 64bit, + * this type can treat both transparently. + *****************************************************************************/ + +#if !defined(_TYPEDEF_CriUint64Adr) +#define _TYPEDEF_CriUint64Adr +typedef CriUint64 CriUint64Adr; /* ポインタまたは64ビットアドレスを格納できる整数型 */ +#endif + +#if !defined(CRI_PTR_TO_UINT64ADR) +#define CRI_PTR_TO_UINT64ADR(ptr) ((CriUint64Adr)(ptr)) /* Convert pointer to CriUint64Adr */ +#endif + +#if !defined(CRI_UINT64ADR_TO_PTR) +#define CRI_UINT64ADR_TO_PTR(uint64adr) ((void *)(CriUintPtr)(uint64adr)) /* Convert CriUint64Adr to pointer */ +#endif + +#if !defined(CRI_XPT_DISABLE_UNPREFIXED_TYPE) + +/***************************************************************************** + * 互換性維持のための定数マクロ + * Macros for compatibility with old version + *****************************************************************************/ + +/* NULL ポインタ型 */ +#if !defined(NULL) +#define NULL (CRI_NULL) +#endif + +/* 論理定数1(偽、真) */ +#if !defined(FALSE) +#define FALSE (CRI_FALSE) +#endif +#if !defined(TRUE) +#define TRUE (CRI_TRUE) +#endif + +/* 論理定数2(スイッチ) */ +#if !defined(OFF) +#define OFF (CRI_OFF) +#endif +#if !defined(ON) +#define ON (CRI_ON) +#endif + +/* 結果判定の定数(成功、失敗) */ +#if !defined(OK) +#define OK (CRI_OK) +#endif +#if !defined(NG) +#define NG (CRI_NG) +#endif + +/***************************************************************************** + * 互換性維持のためのデータ型宣言 + * Types for compatibility with old version + *****************************************************************************/ + +#if !defined(_TYPEDEF_Uint8) +#define _TYPEDEF_Uint8 +typedef CriUint8 Uint8; /* 符号なし1バイト整数 */ +#endif + +#if !defined(_TYPEDEF_Sint8) +#define _TYPEDEF_Sint8 +typedef CriSint8 Sint8; /* 符号つき1バイト整数 */ +#endif + +#if !defined(_TYPEDEF_Uint16) +#define _TYPEDEF_Uint16 +typedef CriUint16 Uint16; /* 符号なし2バイト整数 */ +#endif + +#if !defined(_TYPEDEF_Sint16) +#define _TYPEDEF_Sint16 +typedef CriSint16 Sint16; /* 符号つき2バイト整数 */ +#endif + +#if !defined(_TYPEDEF_Uint32) +#define _TYPEDEF_Uint32 +typedef CriUint32 Uint32; /* 符号なし4バイト整数 */ +#endif + +#if !defined(_TYPEDEF_Sint32) +#define _TYPEDEF_Sint32 +typedef CriSint32 Sint32; /* 符号つき4バイト整数 */ +#endif + +#if !defined(_TYPEDEF_Uint64) +#define _TYPEDEF_Uint64 +typedef CriUint64 Uint64; /* 符号なし8バイト整数 */ +#endif + +#if !defined(_TYPEDEF_Sint64) +#define _TYPEDEF_Sint64 +typedef CriSint64 Sint64; /* 符号つき8バイト整数 */ +#endif + +#if !defined(_TYPEDEF_Uint128) +#define _TYPEDEF_Uint128 +typedef CriUint128 Uint128; /* 符号なし16バイト整数 */ +#endif + +#if !defined(_TYPEDEF_Sint128) +#define _TYPEDEF_Sint128 +typedef CriSint128 Sint128; /* 符号つき16バイト整数 */ +#endif + +#if !defined(_TYPEDEF_Float16) +#define _TYPEDEF_Float16 +typedef CriFloat16 Float16; /* 2バイト実数 */ +#endif + +#if !defined(_TYPEDEF_Float32) +#define _TYPEDEF_Float32 +typedef CriFloat32 Float32; /* 4バイト実数 */ +#endif + +#if !defined(_TYPEDEF_Float64) +#define _TYPEDEF_Float64 +typedef CriFloat64 Float64; /* 8バイト実数 */ +#endif + +#if !defined(_TYPEDEF_Fixed32) +#define _TYPEDEF_Fixed32 +typedef CriFixed32 Fixed32; /* 固定小数点32ビット */ +#endif + +/* X11 API(xtrapproto.h)との競合回避用 */ +#if !defined(_TYPEDEF_Bool) && !defined(Bool) +#define _TYPEDEF_Bool +typedef CriBool Bool; /* 論理型(論理定数を値にとる) */ +#endif + +#if !defined(_TYPEDEF_Char8) +#define _TYPEDEF_Char8 +typedef CriChar8 Char8; /* 文字型 */ +#endif + +#if !defined(_TYPEDEF_SintPtr) +#define _TYPEDEF_SintPtr +typedef CriSintPtr SintPtr; +#endif + +#if !defined(_TYPEDEF_UintPtr) +#define _TYPEDEF_UintPtr +typedef CriUintPtr UintPtr; +#endif + +#endif /* CRI_XPT_DISABLE_UNPREFIXED_TYPE */ + +#endif /* CRI_INCL_CRI_XPT_POST_H */ + +/* end of file */ diff --git a/3rdParty/cri/pc/include/cri_xpts_win.h b/3rdParty/cri/pc/include/cri_xpts_win.h new file mode 100644 index 00000000..1e339dab --- /dev/null +++ b/3rdParty/cri/pc/include/cri_xpts_win.h @@ -0,0 +1,164 @@ +/**************************************************************************** + * + * CRI Middleware SDK + * + * Copyright (c) 1998-2011 CRI Middleware Co., Ltd. + * + * Library : CRI Middleware Library + * Module : CRI Common Header for Windows, Xbox and Xbox360 + * File : cri_xpts_win.h + * Date : 2011-08-10 + * Version : 2.04 + * + ****************************************************************************/ + +#ifndef CRI_INCL_CRI_XPTS_H +#define CRI_INCL_CRI_XPTS_H + +/***************************************************************************** + * 基本データ型宣言 + *****************************************************************************/ + +#if !defined(_TYPEDEF_CriUint8) +#define _TYPEDEF_CriUint8 +typedef unsigned char CriUint8; /* 符号なし1バイト整数 */ +#endif + +#if !defined(_TYPEDEF_CriSint8) +#define _TYPEDEF_CriSint8 +typedef signed char CriSint8; /* 符号つき1バイト整数 */ +#endif + +#if !defined(_TYPEDEF_CriUint16) +#define _TYPEDEF_CriUint16 +typedef unsigned short CriUint16; /* 符号なし2バイト整数 */ +#endif + +#if !defined(_TYPEDEF_CriSint16) +#define _TYPEDEF_CriSint16 +typedef signed short CriSint16; /* 符号つき2バイト整数 */ +#endif + +#if !defined(_TYPEDEF_CriUint32) +#define _TYPEDEF_CriUint32 +typedef unsigned long CriUint32; /* 符号なし4バイト整数 */ +#endif + +#if !defined(_TYPEDEF_CriSint32) +#define _TYPEDEF_CriSint32 +typedef signed long CriSint32; /* 符号つき4バイト整数 */ +#endif + +#if !defined(_TYPEDEF_CriUint64) +#define _TYPEDEF_CriUint64 +typedef unsigned __int64 CriUint64; /* 符号なし8バイト整数 */ +#endif + +#if !defined(_TYPEDEF_CriSint64) +#define _TYPEDEF_CriSint64 +typedef signed __int64 CriSint64; /* 符号つき8バイト整数 */ +#endif + +#if !defined(_TYPEDEF_CriUint128) +#define _TYPEDEF_CriUint128 +typedef struct { /* 符号なし16バイト整数 */ + CriUint64 h; /* 上位64ビット */ + CriUint64 l; /* 下位64ビット */ +} CriUint128; +#endif + +#if !defined(_TYPEDEF_CriSint128) +#define _TYPEDEF_CriSint128 +typedef struct { /* 符号つき16バイト整数 */ + CriSint64 h; /* 上位64ビット */ + CriUint64 l; /* 下位64ビット */ +} CriSint128; +#endif + +#if !defined(_TYPEDEF_CriFloat16) +#define _TYPEDEF_CriFloat16 +typedef signed short CriFloat16; /* 2バイト実数 */ +#endif + +#if !defined(_TYPEDEF_CriFloat32) +#define _TYPEDEF_CriFloat32 +typedef float CriFloat32; /* 4バイト実数 */ +#endif + +#if !defined(_TYPEDEF_CriFloat64) +#define _TYPEDEF_CriFloat64 +typedef double CriFloat64; /* 8バイト実数 */ +#endif + +#if !defined(_TYPEDEF_CriFixed32) +#define _TYPEDEF_CriFixed32 +typedef signed long CriFixed32; /* 固定小数点32ビット */ +#endif + +#if !defined(_TYPEDEF_CriBool) +#define _TYPEDEF_CriBool +typedef CriSint32 CriBool; /* 論理型(論理定数を値にとる) */ +#endif + +#if !defined(_TYPEDEF_CriChar8) +#define _TYPEDEF_CriChar8 +typedef char CriChar8; /* 文字型 */ +#endif + +/***************************************************************************** + * ポインタを格納可能な整数型 + *****************************************************************************/ + +#if defined(CRI_WIN64) || defined(_WIN64) || defined(_M_X64) + +#if !defined(_TYPEDEF_CriSintPtr) +#define _TYPEDEF_CriSintPtr +typedef signed __int64 CriSintPtr; +#endif + +#if !defined(_TYPEDEF_CriUintPtr) +#define _TYPEDEF_CriUintPtr +typedef unsigned __int64 CriUintPtr; +#endif + +#else + +#if defined(_MSC_VER) && (_MSC_VER >= 1300) + +#if !defined(_TYPEDEF_CriSintPtr) +#define _TYPEDEF_CriSintPtr +typedef __w64 signed int CriSintPtr; +#endif + +#if !defined(_TYPEDEF_CriUintPtr) +#define _TYPEDEF_CriUintPtr +typedef __w64 unsigned int CriUintPtr; +#endif + +#else + +#if !defined(_TYPEDEF_CriSintPtr) +#define _TYPEDEF_CriSintPtr +typedef CriSint32 CriSintPtr; +#endif + +#if !defined(_TYPEDEF_CriUintPtr) +#define _TYPEDEF_CriUintPtr +typedef CriUint32 CriUintPtr; +#endif + +#endif + +#endif /* end of _WIN64 */ + +/***************************************************************************** + * 呼び出し規約 + *****************************************************************************/ + +#if !defined(CRIAPI) +#define CRIAPI __cdecl +#endif + +#endif /* CRI_INCL_CRI_XPTS_H */ + +/* end of file */ diff --git a/3rdParty/cri/pc/libs/Win32/cri_base_pcx86.lib b/3rdParty/cri/pc/libs/Win32/cri_base_pcx86.lib new file mode 100644 index 00000000..dc0d4bc7 Binary files /dev/null and b/3rdParty/cri/pc/libs/Win32/cri_base_pcx86.lib differ diff --git a/3rdParty/cri/pc/libs/Win32/cri_movie_pcx86.lib b/3rdParty/cri/pc/libs/Win32/cri_movie_pcx86.lib new file mode 100644 index 00000000..f2fa9e33 Binary files /dev/null and b/3rdParty/cri/pc/libs/Win32/cri_movie_pcx86.lib differ diff --git a/3rdParty/cri/pc/libs/x64/cri_base_pcx64.lib b/3rdParty/cri/pc/libs/x64/cri_base_pcx64.lib new file mode 100644 index 00000000..c8c02f11 Binary files /dev/null and b/3rdParty/cri/pc/libs/x64/cri_base_pcx64.lib differ diff --git a/3rdParty/cri/pc/libs/x64/cri_movie_pcx64.lib b/3rdParty/cri/pc/libs/x64/cri_movie_pcx64.lib new file mode 100644 index 00000000..40705a17 Binary files /dev/null and b/3rdParty/cri/pc/libs/x64/cri_movie_pcx64.lib differ diff --git a/Apps/CMakeLists.txt b/Apps/CMakeLists.txt index 5b85aabf..4f86e2da 100644 --- a/Apps/CMakeLists.txt +++ b/Apps/CMakeLists.txt @@ -43,9 +43,11 @@ if(SF_RENDERER_VULKAN) target_link_libraries(GFxPlayerTinyVulkan PRIVATE sf_core gfxrender_vulkan + $<$:gfxvideo> ) target_link_options(GFxPlayerTinyVulkan PRIVATE /WHOLEARCHIVE:libgfxrender_vulkan + $<$:/WHOLEARCHIVE:libgfxvideo> ) set_target_properties(GFxPlayerTinyVulkan PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/Bin/$,x64,Win32>/Msvc10/GFxPlayerTinyVulkan" @@ -56,13 +58,14 @@ endif() # PlayerTiny -- minimal player (D3D9/D3D10/D3D11/GL, each a separate target) # --------------------------------------------------------------------------- if(SF_RENDERER_D3D11) - add_executable(PlayerTiny_D3D11 WIN32 + add_executable(PlayerTiny_D3D11 ${CMAKE_SOURCE_DIR}/Apps/Samples/Common/FxSoundFMOD.cpp ${CMAKE_SOURCE_DIR}/Apps/Samples/GFxPlayerTiny/GFxPlayerTinyD3D1x.cpp ) sf_apply_app_flags(PlayerTiny_D3D11) target_link_libraries(PlayerTiny_D3D11 PRIVATE sf_core gfxrender_d3d1x gfxsound_fmod dsound Msacm32 + $<$:gfxvideo> ) set_target_properties(PlayerTiny_D3D11 PROPERTIES OUTPUT_NAME "PlayerTiny" diff --git a/Apps/Samples/GFxPlayerTiny/GFxPlayerTinyD3D1x.cpp b/Apps/Samples/GFxPlayerTiny/GFxPlayerTinyD3D1x.cpp index dae37741..c668b094 100644 --- a/Apps/Samples/GFxPlayerTiny/GFxPlayerTinyD3D1x.cpp +++ b/Apps/Samples/GFxPlayerTiny/GFxPlayerTinyD3D1x.cpp @@ -22,6 +22,11 @@ otherwise accompanies this software in either electronic or hard copy form. #include "../Common/FxSoundFMOD.h" #endif +#ifdef GFX_ENABLE_VIDEO +#include "Video/Video_VideoPC.h" +#include "Video/Video_VideoSoundSystemDX8.h" +#endif + #include "Render/ImageFiles/PNG_ImageFile.h" #include "Render/ImageFiles/DDS_ImageFile.h" @@ -393,6 +398,14 @@ int FxPlayerTiny::Run() Ptr pAS2Support = *new GFx::AS2Support(); loader.SetAS2Support(pAS2Support); +#ifdef GFX_ENABLE_VIDEO + UInt32 affinityMasks[] = { 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF }; + Ptr pVideo = *new Video::VideoPC(Video::VideoVMSupportAll(), + Thread::NormalPriority, 3, affinityMasks); + pVideo->SetSoundSystem(Ptr(*new Video::VideoSoundSystemDX8(0))); + loader.SetVideo(pVideo); +#endif + FxPlayerThreadCommandQueue* queue = new FxPlayerThreadCommandQueue; pCommandQueue = queue; // Load the movie file and create its instance. @@ -416,7 +429,7 @@ int FxPlayerTiny::Run() hMovieDisplay = pMovie->GetDisplayHandle(); // Create renderer. - pRenderHAL = *new Render::D3D1x::HAL(); + pRenderHAL = *new Render::D3D1x::HAL(queue); if (!(pRenderer = *new Render::Renderer2D(pRenderHAL.GetPtr()))) return 1; @@ -429,6 +442,11 @@ int FxPlayerTiny::Run() if (!pRenderHAL->InitHAL(D3D1x::HALInitParams(pDevice D3D11(, pDeviceContext)))) return 1; +#ifdef GFX_ENABLE_VIDEO + if (pVideo) + pVideo->SetTextureManager(pRenderHAL->GetTextureManager()); +#endif + // Set renderer on loader so that it is also applied to all children. //pRenderConfig = *new RenderConfig(pRenderer, RenderConfig::RF_EdgeAA | RenderConfig::RF_StrokeNormal); //pRenderConfig = *new RenderConfig(); diff --git a/Apps/Samples/GFxPlayerTiny/GFxPlayerTinyVulkan.cpp b/Apps/Samples/GFxPlayerTiny/GFxPlayerTinyVulkan.cpp index ee3b34e8..422e0c48 100644 --- a/Apps/Samples/GFxPlayerTiny/GFxPlayerTinyVulkan.cpp +++ b/Apps/Samples/GFxPlayerTiny/GFxPlayerTinyVulkan.cpp @@ -27,6 +27,12 @@ Authors : Scaleform Vulkan Backend #include "GFx_Renderer_Vulkan.h" #include "Render/Renderer2D.h" +#ifdef GFX_ENABLE_VIDEO +#include "Video/Video_Video.h" +#include "Video/Video_VideoPC.h" +#include "Video/Video_VideoSoundSystemDX8.h" +#endif + using namespace Scaleform; using namespace Scaleform::Render; using namespace Scaleform::GFx; @@ -136,12 +142,36 @@ class GFxFileLog : public Scaleform::Log } }; +// Single-threaded command queue: provides render interfaces (HAL, Renderer2D, +// TextureManager) to the movie system so that video textures can be created. +class VulkanThreadCommandQueue : public Render::ThreadCommandQueue +{ +public: + virtual void GetRenderInterfaces(Render::Interfaces* p) + { + p->pHAL = pHAL; + p->pRenderer2D = pR2D; + p->pTextureManager = pHAL ? pHAL->GetTextureManager() : nullptr; + p->RenderThreadID = 0; + } + virtual void PushThreadCommand(ThreadCommand* command) + { + if (command) command->Execute(); + } + Render::HAL* pHAL; + Render::Renderer2D* pR2D; +}; + // Scaleform objects static Ptr pHAL; static Ptr pRenderer; static Loader* pLoader = nullptr; static Ptr pMovieDef; static Ptr pMovie; +static VulkanThreadCommandQueue* pCommandQueue = nullptr; +#ifdef GFX_ENABLE_VIDEO +static Ptr pVideo; +#endif // Forward declarations bool InitVulkan(); @@ -1031,10 +1061,20 @@ static int AppMain(LPSTR lpCmdLine) Ptr pAS3Support = *new GFx::AS3Support(); pLoader->SetAS3Support(pAS3Support); + // Set up the single-threaded command queue so the movie system can access + // the TextureManager (required for video texture creation and BitmapData). + pCommandQueue = new VulkanThreadCommandQueue(); + pCommandQueue->pHAL = pHAL.GetPtr(); + pCommandQueue->pR2D = pRenderer.GetPtr(); + // Provide the GPU TextureManager so embedded SWF bitmaps are uploaded as GPU textures. Ptr pImageCreator = *SF_NEW GFx::ImageCreator(pHAL->GetTextureManager()); pLoader->SetImageCreator(pImageCreator); + // FileOpener is required so GFx can open SWF-referenced files (video .usm, images, etc.) + Ptr pFileOpener = *SF_NEW FileOpener; + pLoader->SetFileOpener(pFileOpener); + // Route all GFx/AS3 messages to the log file Ptr pGFxLog = *SF_NEW GFxFileLog(); pLoader->SetLog(pGFxLog); @@ -1043,6 +1083,17 @@ static int AppMain(LPSTR lpCmdLine) GFx::ActionControl::Action_Verbose | GFx::ActionControl::Action_LogAllFilenames); pLoader->SetActionControl(pActionCtrl); +#ifdef GFX_ENABLE_VIDEO + // Video playback (CRI Sofdec2) + pVideo = *new GFx::Video::VideoPC(GFx::Video::VideoVMSupportAll(), + Thread::NormalPriority, 3, NULL); + pVideo->SetSoundSystem( + Ptr(*new GFx::Video::VideoSoundSystemDX8(0))); + pVideo->SetTextureManager(pHAL->GetTextureManager()); + pLoader->SetVideo(pVideo); + if (vkLogFile) { fprintf(vkLogFile, "Video support initialized (CRI Movie + DirectSound)\n"); fflush(vkLogFile); } +#endif + if (vkLogFile) { fprintf(vkLogFile, "Loader created (AS2+AS3 support, verbose logging ON), loading SWF: %s\n", swfPath); fflush(vkLogFile); } pMovieDef = *pLoader->CreateMovie(swfPath, Loader::LoadAll); if (!pMovieDef) @@ -1052,7 +1103,7 @@ static int AppMain(LPSTR lpCmdLine) else { if (vkLogFile) { fprintf(vkLogFile, "MovieDef loaded OK: %s\n", swfPath); fflush(vkLogFile); } - pMovie = *pMovieDef->CreateInstance(); + pMovie = *pMovieDef->CreateInstance(false, 0, NULL, pCommandQueue); if (pMovie) { if (vkLogFile) { fprintf(vkLogFile, "Movie instance created, setting viewport %ux%u\n", WindowWidth, WindowHeight); fflush(vkLogFile); } @@ -1238,8 +1289,13 @@ static int AppMain(LPSTR lpCmdLine) if (vkDevice) vkDeviceWaitIdle(vkDevice); pMovie.Clear(); pMovieDef.Clear(); +#ifdef GFX_ENABLE_VIDEO + pVideo.Clear(); +#endif delete pLoader; pLoader = nullptr; + delete pCommandQueue; + pCommandQueue = nullptr; pRenderer.Clear(); if (pHAL) { pHAL->ShutdownHAL(); pHAL.Clear(); } CleanupVulkan(); diff --git a/CMakeLists.txt b/CMakeLists.txt index 3c583261..fe4c3b2a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,6 +15,7 @@ option(SF_BUILD_SAMPLES "Build sample applications" ON) option(SF_BUILD_KITS "Build kit demo applications" OFF) option(SF_BUILD_TESTS "Build test applications" OFF) option(SF_USE_SCU "Use single compilation units" OFF) +option(SF_ENABLE_VIDEO "Build video playback (CRI SDK)" OFF) # --------------------------------------------------------------------------- # Global compile settings diff --git a/Src/CMakeLists.txt b/Src/CMakeLists.txt index fc59ea6f..35424cd5 100644 --- a/Src/CMakeLists.txt +++ b/Src/CMakeLists.txt @@ -472,6 +472,7 @@ add_library(gfx_as3 STATIC ${CMAKE_SOURCE_DIR}/Src/GFx/AS3/Obj/Media/AS3_Obj_Media_SoundLoaderContext.cpp ${CMAKE_SOURCE_DIR}/Src/GFx/AS3/Obj/Media/AS3_Obj_Media_SoundMixer.cpp ${CMAKE_SOURCE_DIR}/Src/GFx/AS3/Obj/Media/AS3_Obj_Media_SoundTransform.cpp + ${CMAKE_SOURCE_DIR}/Src/GFx/AS3/Obj/Media/AS3_Obj_Media_Video.cpp ${CMAKE_SOURCE_DIR}/Src/GFx/AS3/Obj/Net/AS3_Obj_Net_FileFilter.cpp ${CMAKE_SOURCE_DIR}/Src/GFx/AS3/Obj/Net/AS3_Obj_Net_FileReference.cpp ${CMAKE_SOURCE_DIR}/Src/GFx/AS3/Obj/Net/AS3_Obj_Net_FileReferenceList.cpp @@ -479,6 +480,7 @@ add_library(gfx_as3 STATIC ${CMAKE_SOURCE_DIR}/Src/GFx/AS3/Obj/Net/AS3_Obj_Net_IDynamicPropertyWriter.cpp ${CMAKE_SOURCE_DIR}/Src/GFx/AS3/Obj/Net/AS3_Obj_Net_LocalConnection.cpp ${CMAKE_SOURCE_DIR}/Src/GFx/AS3/Obj/Net/AS3_Obj_Net_NetConnection.cpp + ${CMAKE_SOURCE_DIR}/Src/GFx/AS3/Obj/Net/AS3_Obj_Net_NetStream.cpp ${CMAKE_SOURCE_DIR}/Src/GFx/AS3/Obj/Net/AS3_Obj_Net_ObjectEncoding.cpp ${CMAKE_SOURCE_DIR}/Src/GFx/AS3/Obj/Net/AS3_Obj_Net_Responder.cpp ${CMAKE_SOURCE_DIR}/Src/GFx/AS3/Obj/Net/AS3_Obj_Net_SharedObject.cpp @@ -745,6 +747,64 @@ sf_apply_compile_flags(gfxsound_fmod) target_link_libraries(gfxsound_fmod PRIVATE fmod) set_target_properties(gfxsound_fmod PROPERTIES OUTPUT_NAME "libgfxsound_fmod") +# --------------------------------------------------------------------------- +# libgfxvideo -- CRI Movie video playback +# --------------------------------------------------------------------------- +if(SF_ENABLE_VIDEO) + # Locate CRI Movie SDK (headers + prebuilt libs) + set(SF_CRI_SDK_DIR "${CMAKE_SOURCE_DIR}/3rdParty/cri/pc" CACHE PATH + "Path to CRI Movie SDK (must contain include/ and libs/)") + if(NOT EXISTS "${SF_CRI_SDK_DIR}/include/cri_movie.h") + message(FATAL_ERROR + "SF_ENABLE_VIDEO=ON but CRI Movie SDK not found at ${SF_CRI_SDK_DIR}\n" + "Set SF_CRI_SDK_DIR to the directory containing include/cri_movie.h") + endif() + + # CRI imported libraries + add_library(cri_movie STATIC IMPORTED) + add_library(cri_base STATIC IMPORTED) + if(CMAKE_SIZEOF_VOID_P EQUAL 8) + set_target_properties(cri_movie PROPERTIES IMPORTED_LOCATION + "${SF_CRI_SDK_DIR}/libs/x64/cri_movie_pcx64.lib") + set_target_properties(cri_base PROPERTIES IMPORTED_LOCATION + "${SF_CRI_SDK_DIR}/libs/x64/cri_base_pcx64.lib") + else() + set_target_properties(cri_movie PROPERTIES IMPORTED_LOCATION + "${SF_CRI_SDK_DIR}/libs/Win32/cri_movie_pcx86.lib") + set_target_properties(cri_base PROPERTIES IMPORTED_LOCATION + "${SF_CRI_SDK_DIR}/libs/Win32/cri_base_pcx86.lib") + endif() + + add_library(gfxvideo STATIC + ${CMAKE_SOURCE_DIR}/Src/Video/Video_Video.cpp + ${CMAKE_SOURCE_DIR}/Src/Video/Video_VideoPC.cpp + ${CMAKE_SOURCE_DIR}/Src/Video/Video_VideoPlayerImpl.cpp + ${CMAKE_SOURCE_DIR}/Src/Video/Video_VideoCharacter.cpp + ${CMAKE_SOURCE_DIR}/Src/Video/Video_VideoImage.cpp + ${CMAKE_SOURCE_DIR}/Src/Video/Video_VideoAS2.cpp + ${CMAKE_SOURCE_DIR}/Src/Video/Video_VideoAS3.cpp + ${CMAKE_SOURCE_DIR}/Src/Video/Video_CriHeap.cpp + ${CMAKE_SOURCE_DIR}/Src/Video/Video_CriMvFileReader.cpp + ${CMAKE_SOURCE_DIR}/Src/Video/Video_CriMvSoundGateway.cpp + ${CMAKE_SOURCE_DIR}/Src/Video/Video_CriMvSystemTimer.cpp + ${CMAKE_SOURCE_DIR}/Src/Video/Video_SystemSoundInterface.cpp + ${CMAKE_SOURCE_DIR}/Src/Video/Video_VideoSoundSystemDX8.cpp + ${CMAKE_SOURCE_DIR}/Src/Video/AS2/AS2_NetConnection.cpp + ${CMAKE_SOURCE_DIR}/Src/Video/AS2/AS2_NetStream.cpp + ${CMAKE_SOURCE_DIR}/Src/Video/AS2/AS2_VideoObject.cpp + ${CMAKE_SOURCE_DIR}/Src/Video/AS3/AS3_VideoCharacter.cpp + ${CMAKE_SOURCE_DIR}/Src/Video/AS3/AS3_VideoProviderNetStream.cpp + # AS3 runtime objects needed by video (Video, NetStream class info) + ${CMAKE_SOURCE_DIR}/Src/GFx/AS3/Obj/Media/AS3_Obj_Media_Video.cpp + ${CMAKE_SOURCE_DIR}/Src/GFx/AS3/Obj/Net/AS3_Obj_Net_NetStream.cpp + ) + sf_apply_compile_flags(gfxvideo) + target_include_directories(gfxvideo PRIVATE "${SF_CRI_SDK_DIR}/include") + target_link_libraries(gfxvideo PUBLIC cri_movie cri_base) + target_link_libraries(gfxvideo INTERFACE dsound) + set_target_properties(gfxvideo PROPERTIES OUTPUT_NAME "libgfxvideo") +endif() + # --------------------------------------------------------------------------- # libgfxrender_vulkan -- Vulkan renderer # --------------------------------------------------------------------------- diff --git a/Src/Render/Render_ShaderHAL.h b/Src/Render/Render_ShaderHAL.h index 3b94933d..ff4229d5 100644 --- a/Src/Render/Render_ShaderHAL.h +++ b/Src/Render/Render_ShaderHAL.h @@ -766,7 +766,7 @@ inline void ShaderHAL::DrawProcessedPrim ShaderData.BeginPrimitive(); const typename ShaderManagerType::Shader& pShader = - SManager.SetPrimitiveFill(pprimitive->pFill, fillFlags, pbatch->Type, pbatch->pFormat, + SManager.SetPrimitiveFill(pprimitive->pFill, fillFlags, pbatch->Type, pbatch->pFormat, batchMeshCount, Matrices, &pprimitive->Meshes[meshIndex], &ShaderData); Profiler.SetBatch(this, pprimitive, bidx); diff --git a/Src/Render/Vulkan/Vulkan_MeshCache.cpp b/Src/Render/Vulkan/Vulkan_MeshCache.cpp index 7588f8bb..817731fb 100644 --- a/Src/Render/Vulkan/Vulkan_MeshCache.cpp +++ b/Src/Render/Vulkan/Vulkan_MeshCache.cpp @@ -370,12 +370,10 @@ void MeshCache::BeginFrame() // guaranteed to no longer be referenced by any submitted command buffer. DestroyFrameCount++; destroyReadyPendingBuffers(); - RSync.BeginFrame(); } void MeshCache::EndFrame() { - RSync.EndFrame(); CacheList.EndFrame(); // Buffer destruction is now deferred to BeginFrame (after GPU fence wait). // Do NOT call destroyAllPendingBuffers() here. diff --git a/Src/Render/Vulkan/Vulkan_Shader.cpp b/Src/Render/Vulkan/Vulkan_Shader.cpp index 80b966f4..17ba3878 100644 --- a/Src/Render/Vulkan/Vulkan_Shader.cpp +++ b/Src/Render/Vulkan/Vulkan_Shader.cpp @@ -199,9 +199,11 @@ void ShaderInterface::BeginScene() bool ShaderInterface::SetStaticShader(ShaderDesc::ShaderType shader, const VertexFormat* pformat) { CurShaders.pVFormat = pformat; - CurShaders.pVS = &pHal->SManager.StaticVShaders[VertexShaderDesc::GetShaderIndex(shader, pHal->SManager.ShaderModel)]; + unsigned vsIndex = VertexShaderDesc::GetShaderIndex(shader, pHal->SManager.ShaderModel); + unsigned fsIndex = FragShaderDesc::GetShaderIndex(shader, pHal->SManager.ShaderModel); + CurShaders.pVS = &pHal->SManager.StaticVShaders[vsIndex]; CurShaders.pVDesc = CurShaders.pVS->pDesc; - CurShaders.pFS = &pHal->SManager.StaticFShaders[FragShaderDesc::GetShaderIndex(shader, pHal->SManager.ShaderModel)]; + CurShaders.pFS = &pHal->SManager.StaticFShaders[fsIndex]; CurShaders.pFDesc = CurShaders.pFS->pDesc; if (pformat) @@ -209,8 +211,7 @@ bool ShaderInterface::SetStaticShader(ShaderDesc::ShaderType shader, const Verte // Cache SysVertexFormat per (VertexFormat*, vsIndex) pair. Different shaders // assign different attribute locations (e.g. pos@loc0 vs pos@loc1), so a single // cached SysVertexFormat per VertexFormat is not safe. - unsigned vsIdx = VertexShaderDesc::GetShaderIndex(shader, pHal->SManager.ShaderModel); - UPInt cacheKey = ((UPInt)pformat * 2654435761u) ^ ((UPInt)vsIdx * 2246822519u); + UPInt cacheKey = ((UPInt)pformat * 2654435761u) ^ ((UPInt)vsIndex * 2246822519u); Ptr* ppCached = pHal->SManager.SysVFCache.Get(cacheKey); if (ppCached) { @@ -394,6 +395,8 @@ void ShaderInterface::Finish(unsigned meshCount) memset(pmgr->CurrentTextures, 0, sizeof(pmgr->CurrentTextures)); memset(pmgr->CurrentSamplers, 0, sizeof(pmgr->CurrentSamplers)); + + ShaderInterfaceBase::Finish(meshCount); } diff --git a/Src/Render/Vulkan/Vulkan_Texture.cpp b/Src/Render/Vulkan/Vulkan_Texture.cpp index 9105f5c3..25d996b7 100644 --- a/Src/Render/Vulkan/Vulkan_Texture.cpp +++ b/Src/Render/Vulkan/Vulkan_Texture.cpp @@ -24,6 +24,8 @@ static const TextureFormat::Mapping TextureFormatMapping[] = { Image_R8G8B8, VK_FORMAT_R8G8B8A8_UNORM, 4, &Image_CopyScanline24_Extend_RGB_RGBA, &Image_CopyScanline32_Retract_RGBA_RGB }, { Image_B8G8R8, VK_FORMAT_B8G8R8A8_UNORM, 4, &Image_CopyScanline24_Extend_RGB_RGBA, &Image_CopyScanline32_Retract_RGBA_RGB }, { Image_A8, VK_FORMAT_R8_UNORM, 1, &Image::CopyScanlineDefault, &Image::CopyScanlineDefault }, + { Image_Y8_U2_V2, VK_FORMAT_R8_UNORM, 1, &Image::CopyScanlineDefault, &Image::CopyScanlineDefault }, + { Image_Y8_U2_V2_A8,VK_FORMAT_R8_UNORM, 1, &Image::CopyScanlineDefault, &Image::CopyScanlineDefault }, { Image_DXT1, VK_FORMAT_BC1_RGBA_UNORM_BLOCK, 0, &Image::CopyScanlineDefault, &Image::CopyScanlineDefault }, { Image_DXT3, VK_FORMAT_BC2_UNORM_BLOCK, 0, &Image::CopyScanlineDefault, &Image::CopyScanlineDefault }, { Image_DXT5, VK_FORMAT_BC3_UNORM_BLOCK, 0, &Image::CopyScanlineDefault, &Image::CopyScanlineDefault }, @@ -508,6 +510,14 @@ bool MappedTexture::Map(Render::Texture* ptexture, unsigned mipLevel, unsigned l StartMipLevel = mipLevel; LevelCount = levelCount; + // Initialize Data once before the loop, using pre-allocated Planes array + // (matches D3D11 pattern). Calling Initialize inside the loop would Clear() + // previously set planes on each iteration, corrupting multi-plane textures (YUV). + if (levelCount <= PlaneReserveSize) + Data.Initialize(vktex->GetImageFormat(), levelCount, Planes, texPlaneCount * levelCount, true); + else if (!Data.Initialize(vktex->GetImageFormat(), levelCount, true)) + return false; + UByte* pdata = (UByte*)mapped; unsigned planeIdx = 0; for (unsigned itex = 0; itex < texPlaneCount; itex++) @@ -520,7 +530,6 @@ bool MappedTexture::Map(Render::Texture* ptexture, unsigned mipLevel, unsigned l UPInt pitch = (UPInt)mipW * mapping->BytesPerPixel; UPInt planeSize = pitch * mipH; - Data.Initialize(vktex->GetImageFormat(), level); Data.SetPlane(planeIdx, ImageSize(mipW, mipH), pitch, planeSize, pdata); pdata += planeSize; planeIdx++; diff --git a/Src/Video/Video_VideoImage.cpp b/Src/Video/Video_VideoImage.cpp index 38d6615d..dbaf93ef 100644 --- a/Src/Video/Video_VideoImage.cpp +++ b/Src/Video/Video_VideoImage.cpp @@ -28,8 +28,6 @@ namespace Scaleform { namespace GFx { namespace Video { // Scaleform can try to decode the video image multiple times and take a frame meant // for later. So we try to keep the renderer and decoder in sync to avoid that as much // as possible. -Uint64 GDecodeTick; -Uint64 GRenderTick; using namespace Render; @@ -69,12 +67,6 @@ bool VideoImage::Decode(ImageData* pdest, CopyScanlineFunc func, void* parg) con return true; } - if ( GDecodeTick >= GRenderTick ) - { - return false; - } - ++GDecodeTick; - if (pVideoPlayer->GetCriPlayer()->IsNextFrameOnTime()) { if (pdest->GetPlaneCount() >= 3)