当前位置: 首页>>代码示例>>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;未经允许,请勿转载。