AVCaptureDeviceManager.h [plain text]
#ifndef AVCaptureDeviceManager_h
#define AVCaptureDeviceManager_h
#if ENABLE(MEDIA_STREAM) && USE(AVFOUNDATION)
#include "MediaStreamCenter.h"
#include "MediaStreamSource.h"
#include "MediaStreamTrackSourcesRequestClient.h"
#include <wtf/RetainPtr.h>
#include <wtf/text/WTFString.h>
OBJC_CLASS AVCaptureDevice;
OBJC_CLASS AVCaptureSession;
OBJC_CLASS NSString;
OBJC_CLASS WebCoreAVCaptureDeviceManagerObserver;
namespace WebCore {
class CaptureDevice;
class AVCaptureDeviceManager {
public:
static AVCaptureDeviceManager& shared();
static bool isAvailable();
Vector<RefPtr<TrackSourceInfo>> getSourcesInfo(const String&);
bool verifyConstraintsForMediaType(MediaStreamSource::Type, MediaConstraints*, String&);
RefPtr<MediaStreamSource> bestSourceForTypeAndConstraints(MediaStreamSource::Type, PassRefPtr<MediaConstraints>);
enum ValidConstraints { Width = 0, Height, FrameRate, FacingMode, Gain };
static const Vector<AtomicString>& validConstraintNames();
static const Vector<AtomicString>& validFacingModes();
static bool deviceSupportsFacingMode(AVCaptureDevice*, MediaStreamSourceStates::VideoFacingMode);
static bool isValidConstraint(MediaStreamSource::Type, const String&);
static String bestSessionPresetForVideoSize(AVCaptureSession*, int width, int height);
void registerForDeviceNotifications();
void deviceConnected();
void deviceDisconnected(AVCaptureDevice*);
protected:
AVCaptureDeviceManager();
~AVCaptureDeviceManager();
CaptureDevice* bestDeviceForFacingMode(MediaStreamSourceStates::VideoFacingMode);
bool sessionSupportsConstraint(AVCaptureSession*, MediaStreamSource::Type, const String& name, const String& value);
RetainPtr<WebCoreAVCaptureDeviceManagerObserver> m_objcObserver;
};
}
#endif // ENABLE(MEDIA_STREAM)
#endif // AVCaptureDeviceManager_h