package org.jitsi.nabus.device;

import org.jitsi.impl.neomedia.device.MediaDeviceImpl;
import org.jitsi.nabus.access.CameraAccess;
import org.jitsi.service.neomedia.MediaType;
import org.jitsi.service.neomedia.device.MediaDevice;
import org.jitsi.service.neomedia.format.MediaFormat;

import javax.media.CaptureDeviceInfo;
import java.awt.*;
import java.util.List;

/**
 * Created by Sergey on 11/2/2014.
 */
public class Camera implements CameraAccess {

    private MediaDevice device;
    private CaptureDeviceInfo captureDeviceInfo;

    private int frameRate;
    private Dimension size;

    public Camera(CaptureDeviceInfo captureDeviceInfo) {
        this.device = new MediaDeviceImpl(captureDeviceInfo, MediaType.VIDEO);
        this.captureDeviceInfo = captureDeviceInfo;
    }

    public String getName() {
        return captureDeviceInfo.getName();
    }

    public MediaDevice getDevice() {
        return this.device;
    }

    public MediaFormat getMediaFormat() {
        return this.device.getFormat();
    }

    @Override
    public void setFrameRate(int frameRate) {
        this.frameRate = frameRate;
    }

    @Override
    public List<Dimension> getAvailableCaptureSizes() {
        return null;
    }

    @Override
    public void setCaptureSize(Dimension size) {
        this.size = size;
    }

    @Override
    public void crateScreenShot() {

    }

    @Override
    public void startRecording(String cameraDataHandler) {

    }

    @Override
    public void stopRecording() {

    }
}
