Vorbisfile documentation |
libVorbisfile version 1.65 - 20020702 |
declared in "vorbis/vorbisfile.h"; "vorbis/vorbisfile.h"で定義されている
This is an alternative function used to open and initialize an OggVorbis_File
structure when using a data source other than a file. It allows you to specify custom file manipulation routines and sets up all the related decoding structure.
これはファイル以外のデータソースを使うときに、代わりにOggVorbis_File構造体を初期化して開く関数である。
特殊なファイル操作ルーティンを使うことができるようになる。すべてのデコード関連の準備をする。
Once this has been called, the same OggVorbis_File
struct should be passed to all the libvorbisfile functions.
一度この関数が呼ばれると同じ OggVorbis_File構造体が
すべてのlibvorbisfileの関数に渡されなければならない。
It is often useful to call ov_open_callbacks()
simply to determine whether a given file is a vorbis bitstream. If the
ov_open_callbacks()
call fails, then the file is not recognizable as such. When you use ov_open_callbacks()
for
this, you should fclose() the file pointer if, and only if, the
ov_open_callbacks()
call fails. If it succeeds, you must call ov_clear() to clear
the decoder's buffers and close the file for you.
ov_open_callbacks() の呼び出しは単にファイルがビットストリームであるか判断するのに便利である。
もし ov_open_callbacks() の呼び出しが失敗すればファイルがそのように認識できなかったということだ。
このために ov_open() を使うときで、かつ、ov_open_callbacks() の呼び出しが失敗したときのみ、ファイルポインタを fclose() すべきだ。
もし成功したならデコーダのバッファをクリアするために、ov_clear() を呼ばなければならない。そしてファイルを閉じる。
*訳注: ov_open()のものをコピーしたときの間違いと思われる。ov_open_callbacks() が扱うストリームは FILE* とは限らないので、
「ファイルポインタを fclose() すべき」とは「それぞれのストリームの終了処理をすべき」という意味であると思われる。
See also Callbacks and Non-stdio I/O for information on designing and specifying the required callback functions.
要求される関数を特定し設計するための情報は stdioでないI/Oとコールバック を見よ。
int ov_open_callbacks(void *datasource, OggVorbis_File *vf, char *initial, long ibytes, ov_callbacks callbacks); |
0 indicates success 0は成功を示す less than zero for failure: 0は未満の時は失敗である
- OV_EREAD - A read from media returned an error.
OV_EREAD - メディアから読み込むときにエラーが返った- OV_ENOTVORBIS - Bitstream is not Vorbis data.
OV_ENOTVORBIS - ビットストリームがVorbisデータではない- OV_EVERSION - Vorbis version mismatch.
OV_EVERSION - Vorbisのバージョンが合わない- OV_EBADHEADER - Invalid Vorbis bitstream header.
OV_EBADHEADER - 無効なVorbisビットストリームヘッダ- OV_EFAULT - Internal logic fault; indicates a bug or heap/stack corruption.
OV_EFAULT - 内部論理エラー。ヒープやスタックの問題、バグを含む。
If your decoder is threaded, it is recommended that you NOT call
ov_open_callbacks()
in the main control thread--instead, call ov_open_callbacks() IN your decode/playback
thread. This is important because ov_open_callbacks() may be a fairly time-consuming
call, given that the full structure of the file is determined at this point,
which may require reading large parts of the file under certain circumstances
(determining all the logical bitstreams in one physical bitstream, for
example).
See Thread Safety for other information on using libvorbisfile with threads.
copyright © 2002 Xiph.org Vorbisfile documentation libVorbisfile version 1.65 - 20020702
あなたのデコーダーがスレッド化されているなら、ov_open_callbacks()をメインの制御スレッドで代わりに呼ぶことは推奨されない。
ov_open_callbacks()はあなたのデコード/プレイバックスレッドで呼ぶべきである。
ある状況下でファイルの構造すべてをセットするために、多めにファイルを読み込む必要があることがあり、
ov_open_callbacks()は時間が掛かる。(たとえば、1つの物理ビットストリーム内すべての論理ビットストリームを判断するため)
libvorbisをスレッドで使うためのほかの情報はスレッドの安全性を見よ。