本文整理汇总了Java中com.jcraft.jogg.Page类的典型用法代码示例。如果您正苦于以下问题:Java Page类的具体用法?Java Page怎么用?Java Page使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Page类属于com.jcraft.jogg包,在下文中一共展示了Page类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initJOrbis
import com.jcraft.jogg.Page; //导入依赖的package包/类
private void initJOrbis() {
oy = new SyncState();
os = new StreamState();
og = new Page();
op = new Packet();
vi = new Info();
vc = new Comment();
vd = new DspState();
vb = new Block(vd);
buffer = null;
bytes = 0;
oy.init();
}
示例2: init_jorbis
import com.jcraft.jogg.Page; //导入依赖的package包/类
/**
* Initializes all the jOrbis and jOgg vars that are used for song playback.
*/
private void init_jorbis()
{
oggSyncState_ = new SyncState();
oggStreamState_ = new StreamState();
oggPage_ = new Page();
oggPacket_ = new Packet();
vorbisInfo = new Info();
vorbisComment = new Comment();
vorbisDspState = new DspState();
vorbisBlock = new Block(vorbisDspState);
buffer = null;
bytes = 0;
currentBytes = 0L;
oggSyncState_.init();
}
示例3: initJOrbis
import com.jcraft.jogg.Page; //导入依赖的package包/类
private void initJOrbis() {
oy = new SyncState();
os = new StreamState();
og = new Page();
op = new Packet();
vi = new Info();
vc = new Comment();
vd = new DspState();
vb = new Block(vd);
buffer = null;
bytes = 0;
oy.init();
}
示例4: initJOrbis
import com.jcraft.jogg.Page; //导入依赖的package包/类
private void initJOrbis(){
oy=new SyncState();
os=new StreamState();
og=new Page();
op=new Packet();
vi=new Info();
vc=new Comment();
vd=new DspState();
vb=new Block(vd);
buffer=null;
bytes=0;
oy.init();
}
示例5: initializeJOrbis
import com.jcraft.jogg.Page; //导入依赖的package包/类
/**
* Initializes OGG player
*/
private void initializeJOrbis() {
joggPacket = new Packet();
joggPage = new Page();
joggStreamState = new StreamState();
joggSyncState = new SyncState();
jorbisDspState = new DspState();
jorbisBlock = new Block(jorbisDspState);
jorbisComment = new Comment();
jorbisInfo = new Info();
joggSyncState.init();
}
示例6: initJOrbis
import com.jcraft.jogg.Page; //导入依赖的package包/类
/**
* Initialize JOrbis.
*/
void initJOrbis() {
oy = new SyncState();
os = new StreamState();
og = new Page();
op = new Packet();
vi = new Info();
vc = new Comment();
vd = new DspState();
vb = new Block(vd);
oy.init();
}
示例7: getPrevPage
import com.jcraft.jogg.Page; //导入依赖的package包/类
/**
* Get next page.
* @param page the page
* @return offset or OV_* error code
* @throws JOrbisException if an error occurs
*/
private int getPrevPage(Page page) throws JOrbisException {
long begin = offset; // !!!
int ret;
int offst = -1;
while (offst == -1) {
begin -= CHUNKSIZE;
if (begin < 0) {
begin = 0;
}
seekHelper(begin);
while (offset < begin + CHUNKSIZE) {
ret = getNextPage(page, begin + CHUNKSIZE - offset);
if (ret == OV_EREAD) {
return OV_EREAD;
}
if (ret < 0) {
if (offst == -1) {
throw new JOrbisException();
}
break;
}
offst = ret;
}
}
seekHelper(offst); // !!!
ret = getNextPage(page, CHUNKSIZE);
if (ret < 0) {
return OV_EFAULT;
}
return offst;
}
示例8: initializeJOrbis
import com.jcraft.jogg.Page; //导入依赖的package包/类
/**
* Initializes JOrbis.
*/
private void initializeJOrbis()
{
joggPacket = new Packet();
joggPage = new Page();
joggStreamState = new StreamState();
joggSyncState = new SyncState();
jorbisDspState = new DspState();
jorbisBlock = new Block(jorbisDspState);
jorbisComment = new Comment();
jorbisInfo = new Info();
// Initialize SyncState
joggSyncState.init();
}
示例9: init_jorbis
import com.jcraft.jogg.Page; //导入依赖的package包/类
/**
* Initializes all the jOrbis and jOgg vars that are used for song playback.
*/
private void init_jorbis()
{
oggSyncState_ = new SyncState();
oggStreamState_ = new StreamState();
oggPage_ = new Page();
oggPacket_ = new Packet();
vorbisInfo = new Info();
vorbisComment = new Comment();
vorbisDspState = new DspState();
vorbisBlock = new Block(vorbisDspState);
buffer = null;
bytes = 0;
oggSyncState_.init();
}
示例10: init
import com.jcraft.jogg.Page; //导入依赖的package包/类
/**
* Initialize states.
*/
private void init() {
ogg_sync_state = new SyncState();
ogg_stream_state = new StreamState();
ogg_page = new Page();
ogg_packet = new Packet();
vorbis_info = new Info();
vorbis_comment = new Comment();
vorbis_dsp_state = new DspState();
vorbis_block = new Block(vorbis_dsp_state);
ogg_sync_state.init();
}
示例11: queue_page
import com.jcraft.jogg.Page; //导入依赖的package包/类
private int queue_page(Page page)
{
if (theoraPage != 0)
theoraState.pagein(page);
if (vorbisPage != 0)
vorbisState.pagein(page);
return 0;
}
示例12: init_jorbis
import com.jcraft.jogg.Page; //导入依赖的package包/类
/**
* Initializes all the jOrbis and jOgg vars that are used for song playback.
*/
private void init_jorbis()
{
m_oggSyncState = new SyncState();
m_oggStreamState = new StreamState();
m_oggPage = new Page();
m_oggPacket = new Packet();
m_vorbisInfo = new Info();
m_vorbisComment = new Comment();
m_vorbisDspState = new DspState();
m_vorbisBlock = new Block(m_vorbisDspState);
m_oggSyncState.init();
}
示例13: bisectForwardSerialno
import com.jcraft.jogg.Page; //导入依赖的package包/类
/**
* Bisect forward serial number.
* @param begin beginning
* @param searched searched
* @param end end
* @param currentno current number
* @param m member
* @return success flag OV_*
*/
int bisectForwardSerialno(long begin, long searched, long end,
int currentno, int m) {
long endsearched = end;
long next = end;
Page page = new Page();
int ret;
while (searched < endsearched) {
long bisect;
if (endsearched - searched < CHUNKSIZE) {
bisect = searched;
} else {
bisect = (searched + endsearched) / 2;
}
seekHelper(bisect);
ret = getNextPage(page, -1);
if (ret == OV_EREAD) {
return OV_EREAD;
}
if (ret < 0 || page.serialno() != currentno) {
endsearched = bisect;
if (ret >= 0) {
next = ret;
}
} else {
searched = ret + page.headerLen + page.bodyLen;
}
}
seekHelper(next);
ret = getNextPage(page, -1);
if (ret == OV_EREAD) {
return OV_EREAD;
}
if (searched >= end || ret == -1) {
links = m + 1;
offsets = new long[m + 2];
offsets[m + 1] = searched;
} else {
ret = bisectForwardSerialno(next, offset, end, page.serialno(),
m + 1);
if (ret == OV_EREAD) {
return OV_EREAD;
}
}
offsets[m] = begin;
return 0;
}
示例14: fetchHeaders
import com.jcraft.jogg.Page; //导入依赖的package包/类
/**
* Uses the local ogg_stream storage in vf; this is important for
* non-streaming input sources.
* @param vi the info block
* @param vc comment block
* @param serialno serial numbers
* @param ogPtr ogg pointer page
* @return success codes OV_*
*/
int fetchHeaders(Info vi, Comment vc, int[] serialno, Page ogPtr) {
Page og = new Page();
Packet op = new Packet();
int ret;
if (ogPtr == null) {
ret = getNextPage(og, CHUNKSIZE);
if (ret == OV_EREAD) {
return OV_EREAD;
}
if (ret < 0) {
return OV_ENOTVORBIS;
}
ogPtr = og;
}
if (serialno != null) {
serialno[0] = ogPtr.serialno();
}
os.init(ogPtr.serialno());
// extract the initial header from the first page and verify that the
// Ogg bitstream is in fact Vorbis data
vi.init();
vc.init();
int i = 0;
while (i < 3) {
os.pagein(ogPtr);
while (i < 3) {
int result = os.packetout(op);
if (result == 0) {
break;
}
if (result == -1) {
vi.clear();
vc.clear();
os.clear();
return -1;
}
if (vi.synthesisHeaderin(vc, op) != 0) {
vi.clear();
vc.clear();
os.clear();
return -1;
}
i++;
}
if (i < 3) {
if (getNextPage(ogPtr, 1) < 0) {
vi.clear();
vc.clear();
os.clear();
return -1;
}
}
}
return 0;
}
示例15: prefetchAllHeaders
import com.jcraft.jogg.Page; //导入依赖的package包/类
/**
* Last step of the OggVorbis_File initialization; get all the
* vorbis_info structs and PCM positions. Only called by the seekable
* initialization (local stream storage is hacked slightly; pay
* attention to how that's done)
* @param firstInfo first info
* @param firstComment first comment
* @param dataoffset data offset
* @throws JOrbisException if an error occurs
*/
void prefetchAllHeaders(Info firstInfo, Comment firstComment, int dataoffset)
throws JOrbisException {
Page og = new Page();
int ret;
vi = new Info[links];
vc = new Comment[links];
dataoffsets = new long[links];
pcmlengths = new long[links];
serialnos = new int[links];
for (int i = 0; i < links; i++) {
if (firstInfo != null && firstComment != null && i == 0) {
// we already grabbed the initial header earlier. This just
// saves the waste of grabbing it again
vi[i] = firstInfo;
vc[i] = firstComment;
dataoffsets[i] = dataoffset;
} else {
// seek to the location of the initial header
seekHelper(offsets[i]); // !!!
vi[i] = new Info();
vc[i] = new Comment();
if (fetchHeaders(vi[i], vc[i], null, null) == -1) {
dataoffsets[i] = -1;
} else {
dataoffsets[i] = offset;
os.clear();
}
}
// get the serial number and PCM length of this link. To do this,
// get the last page of the stream
long end = offsets[i + 1]; // !!!
seekHelper(end);
while (true) {
ret = getPrevPage(og);
if (ret == -1) {
// this should not be possible
vi[i].clear();
vc[i].clear();
break;
}
if (og.granulepos() != -1) {
serialnos[i] = og.serialno();
pcmlengths[i] = og.granulepos();
break;
}
}
}
}