當前位置: 首頁>>代碼示例>>Java>>正文


Java UnsupportedFormatException類代碼示例

本文整理匯總了Java中org.jcodec.api.UnsupportedFormatException的典型用法代碼示例。如果您正苦於以下問題:Java UnsupportedFormatException類的具體用法?Java UnsupportedFormatException怎麽用?Java UnsupportedFormatException使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


UnsupportedFormatException類屬於org.jcodec.api包,在下文中一共展示了UnsupportedFormatException類的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: JcodecFrameGrab

import org.jcodec.api.UnsupportedFormatException; //導入依賴的package包/類
public JcodecFrameGrab(SeekableByteChannel in) throws IOException, JCodecException {
    ByteBuffer header = ByteBuffer.allocate(65536);
    in.read(header);
    header.flip();
    Format detectFormat = JCodecUtil.detectFormat(header);

    switch (detectFormat) {
    case MOV:
        MP4Demuxer d1 = new MP4Demuxer(in);
        videoTrack = d1.getVideoTrack();
        break;
    case MPEG_PS:
        throw new UnsupportedFormatException("MPEG PS is temporarily unsupported.");
    case MPEG_TS:
        throw new UnsupportedFormatException("MPEG TS is temporarily unsupported.");
    default:
        throw new UnsupportedFormatException("Container format is not supported by JCodec");
    }
    decodeLeadingFrames();
}
 
開發者ID:vitrivr,項目名稱:cineast,代碼行數:21,代碼來源:JcodecFrameGrab.java

示例2: detectDecoder

import org.jcodec.api.UnsupportedFormatException; //導入依賴的package包/類
private ContainerAdaptor detectDecoder(SeekableDemuxerTrack videoTrack, Packet frame) throws JCodecException {
     if (videoTrack instanceof AbstractMP4DemuxerTrack) {
         SampleEntry se = ((AbstractMP4DemuxerTrack) videoTrack).getSampleEntries()[((MP4Packet) frame).getEntryNo()];
         VideoDecoder byFourcc = byFourcc(se.getHeader().getFourcc());
         if (byFourcc instanceof H264Decoder) {
	return new AVCMP4Adaptor(((AbstractMP4DemuxerTrack) videoTrack).getSampleEntries());
}
     }

     throw new UnsupportedFormatException("Codec is not supported");
 }
 
開發者ID:vitrivr,項目名稱:cineast,代碼行數:12,代碼來源:JcodecFrameGrab.java

示例3: FrameGrab

import org.jcodec.api.UnsupportedFormatException; //導入依賴的package包/類
public FrameGrab(SeekableByteChannel in) throws IOException, JCodecException {
	ByteBuffer header = ByteBuffer.allocate(65536);
	in.read(header);
	header.flip();
	Format detectFormat = JCodecUtil.detectFormat(header);

	switch (detectFormat) {
	case MOV:
		MP4Demuxer d1 = new MP4Demuxer(in);
		videoTrack = d1.getVideoTrack();
		if(!(d1.getAudioTracks().isEmpty())) {
			audioTrack = d1.getAudioTracks().get(0);
			AudioSampleEntry as = (AudioSampleEntry) audioTrack.getSampleEntries()[0]; 
			audioInfo = new AudioFormat(
					as.getFormat().isSigned() ? Encoding.PCM_SIGNED : Encoding.PCM_UNSIGNED, 
							as.getFormat().getSampleRate(),
							as.getFormat().getSampleSizeInBits(), 
							as.getFormat().getChannels(),
							as.getFormat().getFrameSize(),
							as.getFormat().getFrameRate(), 
							as.getFormat().isBigEndian());
			audioDecoder = audioDecoder(as.getFourcc());
			audioBuffer  = ByteBuffer.allocate(96000 * audioInfo.getFrameSize() * 10);
		} else {
			audioTrack   = null;
			audioInfo    = null;
			audioDecoder = null;
			audioBuffer  = null;
		}
		break;
	case MPEG_PS:
		throw new UnsupportedFormatException("MPEG PS is temporarily unsupported.");
	case MPEG_TS:
		throw new UnsupportedFormatException("MPEG TS is temporarily unsupported.");
	default:
		throw new UnsupportedFormatException("Container format is not supported by JCodec");
	}
	decodeLeadingFrames();
}
 
開發者ID:arisona,項目名稱:ether,代碼行數:40,代碼來源:FrameGrab.java

示例4: detectDecoder

import org.jcodec.api.UnsupportedFormatException; //導入依賴的package包/類
private ContainerAdaptor detectDecoder(SeekableDemuxerTrack videoTrack, Packet frame) throws JCodecException {
	if (videoTrack instanceof AbstractMP4DemuxerTrack) {
		SampleEntry se = ((AbstractMP4DemuxerTrack) videoTrack).getSampleEntries()[((MP4Packet) frame).getEntryNo()];
		VideoDecoder byFourcc = videoDecoder(se.getHeader().getFourcc());
		if (byFourcc instanceof H264Decoder)
			return new AVCMP4Adaptor(((AbstractMP4DemuxerTrack) videoTrack).getSampleEntries());
	}
	throw new UnsupportedFormatException("Codec is not supported");
}
 
開發者ID:arisona,項目名稱:ether,代碼行數:10,代碼來源:FrameGrab.java


注:本文中的org.jcodec.api.UnsupportedFormatException類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。