001: /*
002: *
003: * Copyright (c) 2000 Silvere Martin-Michiellot All Rights Reserved.
004: *
005: * Silvere Martin-Michiellot grants you ("Licensee") a non-exclusive,
006: * royalty free, license to use, modify and redistribute this
007: * software in source and binary code form,
008: * provided that i) this copyright notice and license appear on all copies of
009: * the software; and ii) Licensee does not utilize the software in a manner
010: * which is disparaging to Silvere Martin-Michiellot.
011: *
012: * This software is provided "AS IS," without a warranty of any kind. ALL
013: * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING ANY
014: * IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
015: * NON-INFRINGEMENT, ARE HEREBY EXCLUDED. Silvere Martin-Michiellot
016: * AND ITS LICENSORS SHALL NOT BE LIABLE FOR ANY DAMAGES
017: * SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING
018: * OR DISTRIBUTING THE SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL
019: * Silvere Martin-Michiellot OR ITS LICENSORS BE LIABLE
020: * FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT,
021: * INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER
022: * CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF
023: * OR INABILITY TO USE SOFTWARE, EVEN IF Silvere Martin-Michiellot HAS BEEN
024: * ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
025: *
026: * This software is not designed or intended for use in on-line control of
027: * aircraft, air traffic, aircraft navigation or aircraft communications; or in
028: * the design, construction, operation or maintenance of any nuclear
029: * facility. Licensee represents and warrants that it will not use or
030: * redistribute the Software for such purposes.
031: *
032: * @Author: Silvere Martin-Michiellot
033: *
034: */
035:
036: package com.db.media.out;
037:
038: import java.awt.Dimension;
039: import javax.media.Buffer;
040: import javax.media.Format;
041: import javax.media.format.VideoFormat;
042: import javax.media.protocol.*;
043:
044: /*
045: * J3DPullBufferSourceStream associated with its J3DPullDataSource
046: */
047:
048: public class J3DPullBufferSourceStream implements PullBufferStream {
049:
050: private ContentDescriptor contentDescriptor;
051: private Buffer iBuffer;
052:
053: J3DPullBufferSourceStream(Buffer buffer) {
054:
055: ContentDescriptor contentDescriptor = new ContentDescriptor(
056: "Java3DMediaCapture");
057: iBuffer = buffer;
058:
059: }
060:
061: public void read(Buffer buffer) {
062:
063: buffer = iBuffer;
064:
065: }
066:
067: public boolean willReadBlock() {
068:
069: return false;
070:
071: }
072:
073: public boolean endOfStream() {
074:
075: return false;
076:
077: }
078:
079: public ContentDescriptor getContentDescriptor() {
080:
081: return contentDescriptor;
082:
083: }
084:
085: public long getContentLength() {
086:
087: return SourceStream.LENGTH_UNKNOWN;
088:
089: }
090:
091: public java.lang.Object getControl(java.lang.String controlType) {
092:
093: return null;
094:
095: }
096:
097: public java.lang.Object[] getControls() {
098:
099: Object[] objects;
100:
101: objects = new Object[0];
102:
103: return objects;
104:
105: }
106:
107: public Format getFormat() {
108:
109: //I still don't understand how a Stream of audio AND video
110: //can be stored in ONE Format
111: //I'd like to return a Format[] that would
112: //contain [new AudioFormat(AudioFormat.IMA4), new VideoFormat(VideoFormat.CINEPAK)]
113: return new VideoFormat(VideoFormat.CINEPAK);
114:
115: }
116:
117: }
|