KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > media > exampleplugins > UselessInfoPlugin


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

7 package org.jboss.media.exampleplugins;
8
9 import javax.media.Buffer;
10
11 import org.jboss.logging.Logger;
12 import org.jboss.media.engine.MediaPlugin;
13
14 /**
15  * @version <tt>$Revision: 1.2 $</tt>
16  * @author <a HREF="mailto:spyridon_samothrakis@yahoo.com">Spyridon Samothrakis</a>
17  */

18 public class UselessInfoPlugin extends MediaPlugin
19 {
20
21    private static Logger log = Logger.getLogger(UselessInfoPlugin.class);
22    /* (non-Javadoc)
23     * @see org.jboss.media.engine.MediaPlugin#process(javax.media.Buffer)
24     */

25    public int process(Object JavaDoc out)
26    {
27       // For demo, we'll just print out the frame #, time &
28
// data length.
29
Buffer output = (Buffer)out;
30       long t = (long) (output.getTimeStamp() / 10000000f);
31
32       log.info(
33          "Post: frame #: "
34             + output.getSequenceNumber()
35             + ", time: "
36             + ((float) t) / 100f
37             + ", len: "
38             + output.getLength());
39       return 0;
40    }
41
42 }
43
Popular Tags