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

org.jitsi.service.neomedia.device.MediaDevice Maven / Gradle / Ivy

/*
 * Copyright @ 2015 Atlassian Pty Ltd
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.jitsi.service.neomedia.device;

import java.util.*;

import org.jitsi.service.neomedia.*;
import org.jitsi.service.neomedia.codec.*;
import org.jitsi.service.neomedia.format.*;
import org.jitsi.utils.*;

/**
 * The MediaDevice class represents capture and playback devices that
 * can be used to grab or render media. Sound cards, USB phones and webcams are
 * examples of such media devices.
 *
 * @author Emil Ivov
 */
public interface MediaDevice
{

    /**
     * Returns the MediaDirection supported by this device.
     *
     * @return MediaDirection.SENDONLY if this is a read-only device,
     * MediaDirection.RECVONLY if this is a write-only device and
     * MediaDirection.SENDRECV if this MediaDevice can both
     * capture and render media.
     */
    public MediaDirection getDirection();

    /**
     * Returns the MediaFormat that this device is currently set to use
     * when capturing data.
     *
     * @return the MediaFormat that this device is currently set to
     * provide media in.
     */
    public MediaFormat getFormat();

    /**
     * Returns the MediaType that this device supports.
     *
     * @return MediaType.AUDIO if this is an audio device or
     * MediaType.VIDEO in case of a video device.
     */
    public MediaType getMediaType();

    /**
     * Returns the List of RTPExtensions that this device
     * know how to handle.
     *
     * @return the List of RTPExtensions that this device
     * know how to handle or null if the device does not support any
     * RTP extensions.
     */
    public List getSupportedExtensions();

    /**
     * Returns a list of MediaFormat instances representing the media
     * formats supported by this MediaDevice.
     *
     * @return the list of MediaFormats supported by this device.
     */
    public List getSupportedFormats();

    /**
     * Returns a list of MediaFormat instances representing the media
     * formats supported by this MediaDevice.
     *
     * @param localPreset the preset used to set the send format parameters,
     * used for video and settings.
     * @param remotePreset the preset used to set the receive format parameters,
     * used for video and settings.
     *
     * @return the list of MediaFormats supported by this device.
     */
    public List getSupportedFormats(
            QualityPreset localPreset,
            QualityPreset remotePreset);

     /**
     * Returns a list of MediaFormat instances representing the media
     * formats supported by this MediaDevice and enabled in
     * encodingConfiguration.
     *
     * @param localPreset the preset used to set the send format parameters,
     * used for video and settings.
     * @param remotePreset the preset used to set the receive format parameters,
     * used for video and settings.
     * @param encodingConfiguration the EncodingConfiguration instance
     * to use.
     *
     * @return the list of MediaFormats supported by this device.
     */
    public List getSupportedFormats(
            QualityPreset localPreset,
            QualityPreset remotePreset,
            EncodingConfiguration encodingConfiguration);
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy