New to JMF my players just showing a white screen

Hello
I'm an experienced java programmer but i am new to JMF i'm having trouble applying an effect to a video track i've registered the effect successfully however when i then apply it to the video track all i get is a white screen. the player displays the video fine without the effect plugin applied however when i apply the effect it all goes wrong. i've checked the plugin viewer and data does seem to be moving between the various plugins and when i use a print statement the data is coming out of the plug in correctly. below is my code the player follwed by the effect file. its a real mess because i've been playing around with it for hours trying to get it to work and it's driving me crazy please can someone help!
Thanks
/////////////////***********Effect File************\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
import javax.media.*;
import javax.media.format.*;
import java.awt.*;
public class RGBPassThruEffect implements Effect {
Format inputFormat;
Format outputFormat;
Format[] inputFormats;
Format[] outputFormats;
public RGBPassThruEffect() {
inputFormats = new Format[] {
new RGBFormat(null,
Format.NOT_SPECIFIED,
Format.byteArray,
Format.NOT_SPECIFIED,
24,
3, 2, 1,
3, Format.NOT_SPECIFIED,
Format.TRUE,
Format.NOT_SPECIFIED)
outputFormats = new Format[] {
new RGBFormat(null,
Format.NOT_SPECIFIED,
Format.byteArray,
Format.NOT_SPECIFIED,
24,
3, 2, 1,
3, Format.NOT_SPECIFIED,
Format.TRUE,
Format.NOT_SPECIFIED)
// methods for interface Codec
public Format[] getSupportedInputFormats() {
     return inputFormats;
public Format [] getSupportedOutputFormats(Format input) {
if (input == null) {
return outputFormats;
if (matches(input, inputFormats) != null) {
return new Format[] { outputFormats[0].intersects(input) };
} else {
return new Format[0];
public Format setInputFormat(Format input) {
     inputFormat = input;
     return input;
public Format setOutputFormat(Format output) {
if (output == null || matches(output, outputFormats) == null)
return null;
RGBFormat incoming = (RGBFormat) output;
Dimension size = incoming.getSize();
int maxDataLength = incoming.getMaxDataLength();
int lineStride = incoming.getLineStride();
float frameRate = incoming.getFrameRate();
int flipped = incoming.getFlipped();
int endian = incoming.getEndian();
if (size == null)
return null;
if (maxDataLength < size.width * size.height * 3)
maxDataLength = size.width * size.height * 3;
if (lineStride < size.width * 3)
lineStride = size.width * 3;
if (flipped != Format.FALSE)
flipped = Format.FALSE;
outputFormat = outputFormats[0].intersects(new RGBFormat(size,
maxDataLength,
null,
frameRate,
Format.NOT_SPECIFIED,
Format.NOT_SPECIFIED,
Format.NOT_SPECIFIED,
Format.NOT_SPECIFIED,
Format.NOT_SPECIFIED,
lineStride,
Format.NOT_SPECIFIED,
Format.NOT_SPECIFIED));
//System.out.println("final outputformat = " + outputFormat);
return outputFormat;
// methods for interface PlugIn
public String getName() {
return "Blue Screen Effect";
public void open() {
public void close() {
public void reset() {
// methods for interface javax.media.Controls
public Object getControl(String controlType) {
     return null;
public Object[] getControls() {
     return null;
// Utility methods.
Format matches(Format in, Format outs[]) {
     for (int i = 0; i < outs.length; i++) {
     if (in.matches(outs))
          return outs[i];
     return null;
public int process(Buffer inBuffer, Buffer outBuffer) {
int outputDataLength = ((VideoFormat)outputFormat).getMaxDataLength();
     validateByteArraySize(outBuffer, outputDataLength);
outBuffer.setLength(outputDataLength);
outBuffer.setFormat(outputFormat);
outBuffer.setFlags(inBuffer.getFlags());
byte [] inData = (byte[]) inBuffer.getData();          // Byte array of image in 24 bit RGB
byte [] outData = (byte[]) outBuffer.getData();          // Byte array of image in 24 bit RGB
RGBFormat vfIn = (RGBFormat) inBuffer.getFormat();     // Metadata - format of RGB stream
Dimension sizeIn = vfIn.getSize();               // Dimensions of image
int pixStrideIn = vfIn.getPixelStride();          // bytes between pixels
int lineStrideIn = vfIn.getLineStride();          // bytes between lines
     int bpp = vfIn.getBitsPerPixel();               // bits per pixel of image
     for (int i=0; i < sizeIn.width * sizeIn.height * (bpp/8); i+= pixStrideIn)
          outData[i] = inData[i];                    // Blue
          //System.out.println("Blue: OutData = "+outData[i]+" | InData = "+inData[i]);
          outData[i+1] = inData[i+1];               // Green Don't you just love Intel byte ordering? :-)
          //System.out.println("Green: OutData = "+outData[i+1]+" | InData = "+inData[i+1]);
          outData[i+2] = inData[i+2];               // Red
          //System.out.println("Red: OutData = "+outData[i+2]+" | InData = "+inData[i+2]);
return BUFFER_PROCESSED_OK;
byte[] validateByteArraySize(Buffer buffer,int newSize) {
     Object objectArray=buffer.getData();
     byte[] typedArray;
     if (objectArray instanceof byte[]) {     // is correct type AND not null
          typedArray=(byte[])objectArray;
          if (typedArray.length >= newSize ) { // is sufficient capacity
               return typedArray;
          byte[] tempArray=new byte[newSize]; // re-alloc array
          System.arraycopy(typedArray,0,tempArray,0,typedArray.length);
          typedArray = tempArray;
     } else {
          typedArray = new byte[newSize];
     buffer.setData(typedArray);
     return typedArray;
//////////////////////////******Player file**********\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
import javax.media.*;
import javax.media.format.*;
import javax.media.control.*;
import javax.media.protocol.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;
import java.io.*;
import java.lang.*;
import java.util.*;
class RTPReceiver extends JFrame implements ControllerListener
     JPanel main = new JPanel();
     BorderLayout layout = new BorderLayout();
     boolean realized = false;
     boolean loopBack = true;
     boolean configured = false;
     RGBPassThruEffect Effect = new RGBPassThruEffect();
     TrackControl[] TC;
     static final String CLASS_NAME = "Documents and Settings.Alex Bowman.Desktop.RTPSender.RGBPassThruEffect";
     Processor myPlayer;
     Player player;
     //processor myProcessor;
     public RTPReceiver()
          //super();
          System.out.println(""+PlugInManager.getPlugInList(Effect.inputFormat,Effect.outputFormat,3).size());
          CreateProcessor("rtp://127.0.0.1:8000/video");
          myPlayer.configure();
          while(myPlayer.getState()!=myPlayer.Configured)
          //TC = myPlayer.getTrackControls();
          applyEffect();
          FileTypeDescriptor FTD = new FileTypeDescriptor("RAW");
          myPlayer.setContentDescriptor(FTD);
          blockingRealize();
          myPlayer.start();
          try
               player = Manager.createPlayer(myPlayer.getDataOutput());
          catch (IOException e)
               System.out.println("Error creating player "+e);
          catch (NoPlayerException NPE)
               System.out.println("Error creating player "+NPE);
          player.realize();
          while(player.getState() != player.Realized)
          player.start();
          System.out.println("hello i get here");
          main.add("Centre",player.getVisualComponent());
          main.setLayout(layout);
          main.add("South",player.getControlPanelComponent());
          setTitle("RTP Video Receiver");
          setSize(325,296);
          setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
          setContentPane(main);
          setVisible(true);
          //show();
     public void applyNewPlugin()
          PlugInManager.addPlugIn(CLASS_NAME, Effect.inputFormats, Effect.outputFormats, javax.media.PlugInManager.EFFECT);
          try
PlugInManager.commit();
          catch (IOException e)
               System.out.println("Error commiting PlugIn to system.");
     public void applyEffect()
          TC = myPlayer.getTrackControls();
          Vector V = PlugInManager.getPlugInList(Effect.inputFormat,Effect.outputFormat,3);
          System.out.println("1: "+TC[0].getFormat().toString());
                    //Codec COD = PlugInManager.getPlugInList(Effect.inputFormat,Effect.outputFormat,3).get(0);
                    Codec effectChain[] = {new RGBPassThruEffect()};
                    try
                         System.out.println(""+V.get(0));
                         Format[] input = Effect.getSupportedInputFormats();
                         TC[0].setFormat(input[0]);
                         System.out.println("2: "+TC[0].getFormat().toString());
                         TC[0].setCodecChain(effectChain);
                    catch (UnsupportedPlugInException E)
                         System.out.println("Error applying effect file. "+ E);
     public void CreateProcessor(String URL)
          MediaLocator MRL = new MediaLocator(URL);
          try
               myPlayer = Manager.createProcessor(MRL);
               myPlayer.addControllerListener(this);
          catch (NoPlayerException e)
               System.out.println("NoPlayerException Occurred when trying to create Player for URL "+URL);
          catch (IOException f)
               System.out.println("IO Exception occurred creating Player for RTP stream at URL: "+ URL);
     public synchronized void blockingRealize()
          myPlayer.realize();
          while(realized == false)
               try
                    wait();
               catch (InterruptedException IE)
                    System.out.println("Thread Interupted while waiting on realization of player");
                    System.exit(1);
     /*     if(myPlayer.getVisualComponent() !=null)
               //main.add("Centre",myPlayer.getVisualComponent());
          else
               System.out.println("error creating visual component");
     public synchronized void controllerUpdate(ControllerEvent E)
          if(E instanceof RealizeCompleteEvent)
               realized = true;
               notify();
          if(E instanceof EndOfMediaEvent)
               //code for end of media file in here
               myPlayer.setMediaTime(new Time(0));
               myPlayer.start();
     public void Start()
     public void Stop()
          if(myPlayer != null)
               myPlayer.stop();
               myPlayer.deallocate();
     public static void main(String[] args)
          RTPReceiver RTP = new RTPReceiver();

YYes  this is normal. if you go back to the main screen and view older post, at the bottom click "View More", you will see more posts like your own.

Similar Messages

  • My Macbook doesn't turn on, it just show a white screen and after a while a question mark blink, I cannot click the question mark, and cannot do anything. Any suggestions?

    Hi, my Macbook doesn't turn on, it just show a white screen and after a while a big question mark blinks but nothing else, cannot click the question mark, cannot do anything.Also it makes a funny noise.  Any suggestions?

    Suppose it's a HDD crash. Boot from Install DVD which came with your MacBook(Press C during startup) and open DiskUtility to repair your HDD if it's able to mount.

  • Itunes just shows a white screen that says "ipod"

    Hi!
    My boyfriend just bought an 32 gb ipod touch. When he plugged it into his computer to sync with itunes, the ipod touch was recognized, but instead of the normal screen that shows the touch's serial number and other information, as well as the tabs for syncing music, videos, and applications, all we see is a white screen that says "ipod." I plugged my 32 gb touch into his computer and itunes worked fine. Any advice? Is the ipod the problem or is it itunes?

    Try:
    - Resetting the iPod. Nothing will be lost
    Reset iOS device: Hold down the On/Off button and the Home button at the same time for at
    least ten seconds, until the Apple logo appears.
    - Next try placing the iPod in Recovery Mode and then restoring via iTunes.
    iTunes: Backing up, updating, and restoring iOS software

  • What do I do if my iTouch does't turn on or off and just shows a white screen?

    I was on fb and it suddenly freezes. I press the button (not the on/off one), and then it doesn't respond. I try the on/off button next and it still doesn't respond. I try doing both and it goes to a white screen. I guess it's still on because the light is pretty much on. But what do I do? I use this iTouch to contact people and it's important that I get it back to normal ASAP. Please help!

    Let the battery fully drain. After charging for at least an your try:
    iOS: Not responding or does not turn on
    If still problem time for an appointment at the Genius Bar of an Apple store.

  • Downloaded Premiere elements 10 app, but just get a white screen??

    I have just bought this app and it wont open properly, it just shows a white screen. Can anyone help?

    >still think I need to update
    Yes... no computer company builds one at a time with the "then current" software drivers for all hardware
    A "master tape" (or hard drive image) is made at some point in time, with Operating System and Device Driver software current as of THAT date
    That production master is then copied on each computer's hard drive during assembly... which means the master may be several months out of date
    So... you are using a macbook pro... what about the rest of the questions in the links I posted?

  • Brand new Ipod touch.  we attached to the computer because we don't have wifi.  Now what.  We set up in ID in itunes.  The Ipod won't do anything, just shows itunes on screen but won't budge.

    Brand new Ipod touch.  We attached to the computer because we don't have wifi.  Now what?  We set up in ID in itunes.  The Ipod won't do anything, just shows itunes on screen but won't budge.

    To get iTunes to see your iPod:
    iPhone, iPad, or iPod touch: Device not recognized in iTunes for Windows
    or
    iPhone, iPad, iPod touch: Device not recognized in iTunes for Mac OS X

  • I have restored my new replacement iPhone 5s from my latest iCloud back up. However my camera roll pictures are not displaying. Its not saying i don't have any pictures, it just shows empty white squares? How do I get my pictures back? Thanks!

    I have restored my new replacement iPhone from my latest iCloud back up. However my camera roll pictures are not displaying. Its not saying I don't have any pictures in my camera roll, it has all the spaces for them, but it just shows empty white squares? How do I get my pictures back? Thanks!

    It's difficult to say whether it's stuck or not as the time to restore a backup can depend on many factors.  You'll have to decide when you think it's just not continuing.  You could try turning the phone off (hold the power button until you see the red off slider, then slide to turn off), then back on to see if that would get it going again.
    When you're convinced it's just hung, you can go back to settings and tap Stop Restoring iPhone to stop the restore.  You'll then have to try restoring it again (Settings>General>Reset, tap Erase All Content and Settings, go through the setup screens and when given the option, choose Restore from iCloud Backup).  Be sure it's connected to your charger and wifi while it's restoring the backup.
    You might also try the approach posted here by ezjules: https://discussions.apple.com/message/19518589#19518589.  This seems to have worked for some people who had trouble restoring their photos from an iCloud backup.

  • Love App Tabs but have several that just show a white page as icon how do I get them to appear as a site logo?

    I love the new App Tabs but have several that when pinned just show a white page as the icon, so you have to mouse over them to figure out which one is which. Example is bankdirect.co.nz. Is there a way of getting the site logo to show up so you can see what is what at a glance but still have the nifty space saving size of the App Tab? Thanks!

    SergZak
    Thanks for that. I have to say that there were a couple of screens that appeared to show both the iPhone and iPad and it was the iPad that was showing the icon!
    It is not life threatening, I just thought that something had not installed as it should have.
    Demo
    Thanks for your comment.
    Cheers
    altv

  • A movie I bought a while ago will no longer play, instead it just shows a black screen and no audio. All of the other movies in my library play fine. Any ideas as to whats going on or how to fix it? Thanks for any help.

    A movie I bought a while ago will no longer play, instead it just shows a black screen and no audio. All of the other movies in my library play fine. Any ideas as to whats going on or how to fix it? Thanks for any help.

    Hi 22chill,
    I recommend that we delete and re-download the movie from your purchase history:
    Downloading past purchases from the App Store, iBookstore, and iTunes Store
    http://support.apple.com/kb/HT2519
    Thanks,
    Matt M.

  • When I use camwow, and I take a picture, then i tap the the little thingy that lets you see it. The picture doesnt show. It just shows a black screen with the camwow retro logo in the bottom right corner....PLEASE HELP IMA CRY.

    Please help. Like I said when I go to see the picture it just shows a black screen with the little camwow logo in the bottom right corner. I already tried turning it off and turning it back on, and I already tryed reseting it. PLEASE HELP PLEASEEEEEEEEEEEEEE imma cry.

    I've tried that.. twice. It didn't work for me - any other suggestions?

  • Hello, my iphone 5s fell, thereafter i tried taking a picture, the camera app just shows a black screen and hangs, the front camera works on other apps but the rear camera is not working, all other apps work perfectly well, how do i resolve this

    Hello, my iphone 5s fell, thereafter i tried taking a picture, the camera app just shows a black screen and hangs, the front camera works on other apps (such as facetime and skype) but the rear camera is not working, all other apps work perfectly well, how do i resolve this

    Double tap Home button and delete Camera app from multitask-list.
    Do a
    Reset: Hold down the Sleep/Wake button and the Home button at the same time for at least ten seconds, until the Apple logo appears. Note: You will not lose any data
    If problem persist, make an appointment with genius bar for evaluation.

  • One of my apps won't load it just shows a black screen

    My app won't load it was working earlier but now it won't. I turned the phone off and turn it back off. Killed all the apps and uninstalled it and reinstalled a few minutes later. Now it's just showing a black screen but when I go to kill them the screen is there but I click on it and it goes black again.

    Gain likes for instagram

  • After i enter my password for the wifi in internet recovery mode it just shows a blank screen no disk utility shows why??? NEED HELP

    After i enter my password for the wifi in internet recovery mode it just shows a blank screen no disk utility shows why??? NEED HELP

    Enter your admin passwrod, not Wi-Fi network password.

  • My i touch fell on the floor and is just showing a grey screen.  Can't scroll to turn off or view anything on the screen

    my i touch fell on the floor and is just showing a grey screen.  Can't scroll to turn off or view anything on the screen

    Try here:
    iPod touch: Hardware troubleshooting
    However, you likely have a hardware problem since it started after dropping the iPod.  If the toubleshooting does not solve the peroblem then make an appointment at the Genius Bar of an Apple store.

  • I was almost finished editing my video and suddenly my video files just show a black screen and wont play.

    I was almost finished editing my video and suddenly my video files just show a black screen and wont play.

    MacBook Pro  / Mozilla Firefox / Netflix / Silverlight Update solved - DON'T DWNLOAD FROM NETFLIX
    I solved this problem tonight. I have a MacBook Pro with 10.5.8. I know, it's old. But I love my Netflix and I recently noticed that Firefox plays Netflix much better.  Then I suddenly got this message that I needed to download the latest Silverlight - it only takes 30 seconds! - WRONG.   However, after much searching, I finally did the steps in order and it worked.  
    This was after repeatedly downloading Silverlight from the Netflix site without success.  So here's what I did:
    1. Went to http://www.microsoft.com/getsilverlight/Get-Started/Install/Default.aspx
    2. Followed the directions. I felt like such an idiot for not doing it right before.
    3. Go to your hard drive and search for "Silverlight" to locate ANY existing Silverlight files: .dmg, etc.
        [also check your Libary/ Internet Plug-ins, but the above search is faster]
    4. Drag it all to the trash and empty it.
    5. Go back to the Get  Silverlight page and click on the Install on that page, not the Netflix site.
    6. Note the steps for Safari or Mozilla Firefox - I wanted Firefox, so I follwed those instructions.
    7. Once it's installed, close all the browsers and Restart that bad boy. Right away.
    8. Open a browser, go to Netflix and proceed to joyfully rot your brain with Netflix content. Yay!

Maybe you are looking for