All Downloads are FREE. Search and download functionalities are using the official Maven repository.

uk.co.caprica.vlcj.factory.VideoSurfaceApi Maven / Gradle / Ivy

The newest version!
/*
 * This file is part of VLCJ.
 *
 * VLCJ is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * VLCJ is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with VLCJ.  If not, see .
 *
 * Copyright 2009-2025 Caprica Software Limited.
 */

package uk.co.caprica.vlcj.factory;

import uk.co.caprica.vlcj.player.embedded.videosurface.videoengine.VideoEngine;
import uk.co.caprica.vlcj.player.embedded.videosurface.CallbackVideoSurface;
import uk.co.caprica.vlcj.player.embedded.videosurface.ComponentIdVideoSurface;
import uk.co.caprica.vlcj.player.embedded.videosurface.ComponentVideoSurface;
import uk.co.caprica.vlcj.player.embedded.videosurface.VideoSurfaceAdapters;
import uk.co.caprica.vlcj.player.embedded.videosurface.callback.BufferFormatCallback;
import uk.co.caprica.vlcj.player.embedded.videosurface.callback.RenderCallback;
import uk.co.caprica.vlcj.player.embedded.videosurface.videoengine.VideoEngineCallback;
import uk.co.caprica.vlcj.player.embedded.videosurface.videoengine.VideoEngineVideoSurface;

import java.awt.*;

/**
 * Behaviour pertaining to the creation of video surfaces.
 */
public final class VideoSurfaceApi extends BaseApi {

    VideoSurfaceApi(MediaPlayerFactory factory) {
        super(factory);
    }

    /**
     * Create a new video surface for a Component.
     * 

* The optimal component in a {@link Canvas}, {@link Window} can be used, as can any other AWT {@link Component}, at * least in principle. *

* * @param component component * @return video surface */ public ComponentVideoSurface newVideoSurface(Component component) { return new ComponentVideoSurface(component, VideoSurfaceAdapters.getVideoSurfaceAdapter()); } /** * Create a new video surface for a native component id. * * @param componentId native component id * @return video surface */ public ComponentIdVideoSurface newVideoSurface(long componentId) { return new ComponentIdVideoSurface(componentId, VideoSurfaceAdapters.getVideoSurfaceAdapter()); } /** * Create a new video surface for "direct" rendering via callbacks. * * @param bufferFormatCallback buffer format callback * @param renderCallback render callback * @param lockBuffers true if the video buffer should be locked; false if it should not * @return video surface */ public CallbackVideoSurface newVideoSurface(BufferFormatCallback bufferFormatCallback, RenderCallback renderCallback, boolean lockBuffers) { return new CallbackVideoSurface(bufferFormatCallback, renderCallback, lockBuffers); } /** * Create a new video surface for rendering via video engine callbacks. * * @param videoEngine video engine * @param callback rendering callback * @return video surface */ public VideoEngineVideoSurface newVideoSurface(VideoEngine videoEngine, VideoEngineCallback callback) { return new VideoEngineVideoSurface(videoEngine, callback, VideoSurfaceAdapters.getVideoSurfaceAdapter()); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy