Postby geostein8888 » 16 Jan 2011 17:36
Hello,
thanks for the patch, this works well. The only mystery thing here is, that i'm not able to play the video in my frame, it comes everytime in a extra window as direct 3d output.
i did evrerything as i did it before the playerlist functions and the videosurface is added to my frame and set as videosurface for the embedded mediaplayer.
is there a new feature in this version i have to thinlk about?
with regards
Georg
snapshot of the code (i also changed the code of the sample payer with the contro buttons, and here also a extra window with only the video content comes up):
videoSurface.setBackground(Color.black);
this.videoSurfaceDefDimensions = msmProps.getVideoDimensions();
this.videoSurfaceDimensions = this.videoSurfaceDefDimensions;
// Since we're mixing lightweight Swing components and heavyweight AWT
// components this is probably a good idea
MsmPlayerMouseListener mouseListener = new MsmPlayerMouseListener();
videoSurface.addMouseListener(mouseListener);
videoSurface.addMouseMotionListener(mouseListener);
videoSurface.addMouseWheelListener(mouseListener);
videoSurface.addKeyListener(new MsmPlayerKeyListener());
JPopupMenu.setDefaultLightWeightPopupEnabled(false);
List<String> vlcArgs = new ArrayList<String>();
vlcArgs.add("-vv");
vlcArgs.add("--no-plugins-cache");
if (RuntimeUtil.isWindows()) {
vlcArgs.add("--plugin-path=" + WindowsRuntimeUtil.getVlcInstallDir() + "\\plugins");
}
vlcArgs.add("--sout-keep");
Logger.debug("vlcArgs={}", vlcArgs);
mainFrame = new JFrame("VLC Player 1.1.5 V");
mainFrame.setLayout(new BorderLayout());
mainFrame.setBackground(Color.black);
mainFrame.add(videoSurface, BorderLayout.CENTER);
mediaPlayerFactory = new MediaPlayerFactory(vlcArgs.toArray(new String[vlcArgs.size()]));//, LibVlc.INSTANCE
mediaPlayerFactory.setLogLevel(LogLevel.DBG);
mediaListPlayer = mediaPlayerFactory.newMediaListPlayer();
mediaListPlayer.addMediaListPlayerEventListener(new MediaListPlayerEventListener() {
@Override
public void nextItem(MediaListPlayer mediaListPlayer) {
System.out.println("nextItem()");
}
});
mediaList = mediaPlayerFactory.newMediaList();
mediaPlayer = mediaPlayerFactory.newMediaPlayer(null);
mediaPlayer.setVideoSurface(videoSurface);
mediaListPlayer.setMediaPlayer(mediaPlayer);
mediaPlayer.setPlaySubItems(true);
// Create a new log handler to display the native libvlc log
log = mediaPlayerFactory.newLog();
log.setThreshold(LogLevel.DBG);
logHandler = new LogHandler(log, 1000) // Add a log message handler to send the native log messages to the local log
.addLogMessageHandler(new DefaultLogMessageHandler()) // Add a log message handler to search for media opening error messages in the native log
.addLogMessageHandler(new MatcherLogMessageHandler("^VLC kann die MRL '(.+?)'.*$", new MatcherCallback() {
@Override
public void matched(Matcher matcher) {
Logger.error("failed to open filename {}", matcher.group(1));
System.out.println("GET NET");
}
}));
logHandler.start();
List<AudioOutput> audioOutputs = mediaPlayerFactory.getAudioOutputs();
Logger.debug("audioOutputs={}", audioOutputs);
mediaPlayer.setEnableKeyInputHandling(false);
mediaPlayer.setEnableMouseInputHandling(false);
this.controlsPanel = new PlayerControlsPanel(mediaPlayer, this, msmProps);
mainFrame.add(controlsPanel, BorderLayout.SOUTH);
mainFrame.pack();
here a part of the logg:
[1cae3b74] avcodec decoder warning: Physical channel configuration not set : guessing
[1c9d22cc] main input debug: no usable vout present, spawning one
[1cb7e0dc] main spu text debug: looking for text renderer module: 4 candidates
[1cb7e0dc] freetype spu text debug: Building font databases.
[1c9d22cc] main input debug: Buffering 33%
[1c9d22cc] main input debug: Buffering 33%
[1c9d22cc] main input debug: Buffering 3%
[1c9d22cc] main input debug: Buffering 34%
[1cb7e0dc] freetype spu text debug: Took 22894 microseconds
[1cb7e0dc] freetype spu text debug: Using Arial as font from file C:/Windows/fonts/arial.ttf
[1c9d22cc] main input debug: Buffering 3%
[1c9d22cc] main input debug: control type=1
[1cb7e0dc] freetype spu text debug: using fontsize: 2
[1cb7e0dc] main spu text debug: using text renderer module "freetype"
[1cb7e0dc] main spu text debug: TIMER module_need() : 53.445 ms - Total 53.445 ms / 1 intvls (Avg 53.445 ms)
[1f2cb5bc] main scale debug: looking for video filter2 module: 36 candidates
[1f2cb5bc] swscale scale debug: 32x32 chroma: YUVA -> 16x16 chroma: YUVA with scaling using Bicubic (good quality)
[1f2cb5bc] main scale debug: using video filter2 module "swscale"
[1f2cb5bc] main scale debug: TIMER module_need() : 6.844 ms - Total 6.844 ms / 1 intvls (Avg 6.844 ms)
[1f28195c] main scale debug: looking for video filter2 module: 36 candidates
[1f28195c] yuvp scale debug: YUVP to YUVA converter
[1f28195c] main scale debug: using video filter2 module "yuvp"
[1f28195c] main scale debug: TIMER module_need() : 0.411 ms - Total 0.411 ms / 1 intvls (Avg 0.411 ms)
[1f27cf64] main video output debug: window size: 640x360
[1f27cf64] main video output debug: Deinterlacing available
[1f27cf64] main video output debug: deinterlace 0, mode blend, is_needed 0
[1f27cf64] main video output debug: looking for video output module: 2 candidates
[1f27cf64] vout_wrapper video output debug: Opening vout display wrapper
[0003f0f4] main generic debug: looking for vout display module: 16 candidates
[0003f0f4] direct3d generic debug: creating Vout EventThread
[0003f0f4] direct3d generic debug: DirectXCreateWindow
[199175d4] main window debug: looking for vout window hwnd module: 6 candidates
[199175d4] qt4 window debug: Qt4 interface not found
[199175d4] qt4 window debug: Qt4 interface not found
[199175d4] main window debug: no vout window hwnd module matching "any" could be loaded
[199175d4] main window debug: TIMER module_need() : 0.399 ms - Total 0.399 ms / 1 intvls (Avg 0.399 ms)
[0003f0f4] direct3d generic debug: created video sub-window
[0003f0f4] direct3d generic debug: Vout EventThread running
[0003f0f4] direct3d generic debug: disabling screen saver
[0003f0f4] direct3d generic warning: trying surface pixel format: YV12
[0003f0f4] direct3d generic debug: selected surface pixel format is YV12
[0003f0f4] direct3d generic debug: Direct3D scene created successfully
[0003f0f4] direct3d generic debug: Direct3D device adapter successfully initialized
[0003f0f4] main generic debug: using vout display module "direct3d"
[0003f0f4] main generic debug: TIMER module_need() : 105.832 ms - Total 105.832 ms / 1 intvls (Avg 105.832 ms)
[1f27cf64] main video output debug: using video output module "vout_wrapper"
[1f27cf64] main video output debug: TIMER module_need() : 106.323 ms - Total 106.323 ms / 1 intvls (Avg 106.323 ms)
[1f27cf64] main video output debug: got 1 direct buffer(s)
[1f27cf64] main video output debug: pic render sz 640x360, of (0,0), vsz 640x360, 4cc I420, sar 1:1, msk r0x0 g0x0 b0x0
[1f27cf64] main video output debug: pic in sz 640x360, of (0,0), vsz 640x360, 4cc I420, sar 1:1, msk r0x0 g0x0 b0x0
[1f27cf64] main video output debug: pic out sz 640x360, of (0,0), vsz 640x360, 4cc I420, sar 1:1, msk r0x0 g0x0 b0x0
[1f27cf64] main video output debug: direct render, mapping render pictures 0-23 to system pictures 1-24
[1c9d22cc] main input debug: creating aout