KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > media > format > audio > oggvorbis > OggVorbisFormat


1 /*
2  * JBoss, the OpenSource J2EE webOS
3  *
4  * Distributable under LGPL license.
5  * See terms of license at gnu.org.
6  */

7
8 package org.jboss.media.format.audio.oggvorbis;
9
10 import java.io.InputStream JavaDoc;
11 import java.net.URL JavaDoc;
12
13 import javax.emb.Media;
14 import javax.emb.MediaException;
15 import javax.emb.MediaFormat;
16 import javax.emb.MediaHeader;
17 import javax.emb.MediaSegment;
18
19 /**
20  * Represents the Ogg Vorbis format.
21  *
22  * <p>More info at <a HREF="http://www.vorbis.com/">www.vorbis.com</a> and
23  * <a HREF="http://www.xiph.org/ogg/vorbis/">www.xiph.org/ogg/vorbis</a>.
24  *
25  * @version <tt>$Revision: 1.2 $</tt>
26  * @author <a HREF="mailto:ricardoarguello@users.sourceforge.net">Ricardo Argüello</a>
27  */

28 public class OggVorbisFormat implements MediaFormat
29 {
30    /**
31     * @see javax.emb.MediaFormat#assembleContent(java.net.URL, javax.emb.MediaSegment[])
32     */

33    public byte[] assembleContent(
34       URL JavaDoc mediaLocation,
35       MediaSegment[] mediaSegments)
36       throws MediaException
37    {
38       return null;
39    }
40
41    /**
42     * @see javax.emb.MediaFormat#disassembleContent(java.net.URL, byte[])
43     */

44    public MediaSegment[] disassembleContent(
45       URL JavaDoc mediaLocation,
46       byte[] mediaContent)
47       throws MediaException
48    {
49       return null;
50    }
51
52    /**
53     * @see javax.emb.MediaFormat#extractHeader(java.io.InputStream)
54     */

55    public MediaHeader extractHeader(InputStream JavaDoc content) throws MediaException
56    {
57       if (content == null)
58       {
59          throw new NullPointerException JavaDoc();
60       }
61
62       return new OggVorbisHeader(content);
63    }
64
65    /**
66     * @see javax.emb.MediaFormat#extractProxy(java.io.InputStream)
67     */

68    public Media extractProxy(InputStream JavaDoc content) throws MediaException
69    {
70       // TODO: Create a generic proxy
71
return null;
72    }
73
74    /**
75     * @see javax.emb.MediaFormat#getDefaultMimeType()
76     */

77    public String JavaDoc getDefaultMimeType()
78    {
79       return "application/ogg";
80    }
81
82    /**
83     * @see javax.emb.MediaFormat#isEmbedded()
84     */

85    public boolean isEmbedded()
86    {
87       return false;
88    }
89
90    /**
91     * @see javax.emb.MediaFormat#isStreamingDesirable()
92     */

93    public boolean isStreamingDesirable()
94    {
95       return true;
96    }
97 }
Popular Tags