Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
QTImageProducer no longer working?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

QTImageProducer no longer working?



Does anyone have app where QTImageProducer is still working with QT 7.2?

On both Mac and Windows we now fail creating a QTImageProducer on mov
files (raw DV seems OK).

Thanks in anticipation

Duncan

import java.awt.Dimension;
import java.io.File;

import junit.framework.TestCase;
import quicktime.QTException;
import quicktime.QTSession;
import quicktime.app.view.MoviePlayer ;
import quicktime.app.view.QTImageProducer;
import quicktime.io.QTFile;
import quicktime.std.StdQTConstants4;
import quicktime.std.movies.Movie;
import quicktime.std.movies.media.DataRef;

public class QTImageProductionTest extends TestCase {
    @Override
    protected void setUp() throws Exception {
        QTSession.open();
    }

    @Override
    protected void tearDown() throws Exception {
        QTSession.close();
    }

    public void testQTImageProducerWithMov() throws Exception {
        try {
            testQTIMageProducerWith(new File("testdata/5-frame.mov"));
            fail(); //we can't get here while the exception is thrown
        } catch (QTException expected) {
            //weird new exception with QTImageProducer
            assertEquals(-109, expected.errorCode());
        }
    }

    public void testQTImageProducerWithDv() throws Exception {
        testQTIMageProducerWith(new File("testdata/5-frame.dif"));
    }

    private void testQTIMageProducerWith(File file) throws QTException {
        DataRef dataRef = new DataRef(new QTFile(file));
        Movie movie = Movie.fromDataRef(dataRef,
StdQTConstants4.newMovieAsyncOK);
        MoviePlayer player = new MoviePlayer(movie);

        new QTImageProducer(player, new Dimension(200, 100)); //any
dimension will do
    }
}
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
QuickTime-java mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.