#include <juce_win32_CameraDevice.h>
Classes | |
class | CaptureSession |
class | CaptureSession |
class | CaptureSession |
class | CaptureSession |
class | CaptureSession |
class | CaptureSession |
struct | CaptureSessionMode |
struct | CaptureSessionModeBase |
struct | CaptureSessionPreviewMode |
struct | CaptureSessionVideoRecordingMode |
struct | DelegateClass |
class | DeviceOrientationChangeListener |
struct | GrabberCallback |
class | ImageReader |
class | ImageReader |
struct | IOSVersion |
class | MediaRecorder |
class | PreviewDisplay |
class | PreviewDisplay |
class | ScopedCameraDevice |
class | ScopedCameraDevice |
class | ScopedCameraDevice |
class | ScopedCameraDevice |
class | StreamConfigurationMap |
Public Types | |
using | InternalOpenCameraResultCallback = std::function< void(const String &, const String &)> |
using | InternalOpenCameraResultCallback = std::function< void(const String &, const String &)> |
Public Member Functions | |
Pimpl (CameraDevice &ownerToUse, const String &, int, int, int, int, int, bool useHighQuality) | |
Pimpl (CameraDevice &ownerToUse, const String &cameraIdToUse, int, int, int, int, int, bool useHighQuality) | |
Pimpl (CameraDevice &ownerToUse, const String &, int index, int minWidth, int minHeight, int maxWidth, int maxHeight, bool) | |
Pimpl (CameraDevice &ownerToUse, const String &cameraIdToUse, int, int minWidthToUse, int minHeightToUse, int maxWidthToUse, int maxHeightToUse, bool) | |
~Pimpl () | |
~Pimpl () | |
~Pimpl () | |
void | addImageCapture () |
void | addListener (CameraDevice::Listener *listenerToAdd) |
void | addListener (CameraDevice::Listener *listenerToAdd) |
void | addListener (CameraDevice::Listener *listenerToAdd) |
void | addListener (CameraDevice::Listener *listenerToAdd) |
void | addMovieCapture () |
void | addUser () |
void | callListeners (const Image &image) |
void | cameraSessionRuntimeError (const String &error) |
void | continueOpenRequest (bool granted) |
bool | createFileCaptureFilter (const File &file, int quality) |
void | drawCurrentImage (Graphics &g, Rectangle< int > area) |
String | getCameraId () const noexcept |
String | getCameraId () const noexcept |
Time | getTimeOfFirstRecordedFrame () const |
Time | getTimeOfFirstRecordedFrame () const |
Time | getTimeOfFirstRecordedFrame () const |
Time | getTimeOfFirstRecordedFrame () const |
AVCaptureConnection * | getVideoConnection () const |
void | handleFrame (double, BYTE *buffer, long) |
void | handleImageCapture (const Image &image) |
void | notifyPictureTakenIfNeeded (const Image &image) |
void | open (InternalOpenCameraResultCallback cameraOpenCallbackToUse) |
void | open (InternalOpenCameraResultCallback cameraOpenCallbackToUse) |
bool | openedOk () const noexcept |
bool | openedOk () const noexcept |
bool | openedOk () const noexcept |
bool | openedOk () const noexcept |
void | refreshConnections () |
void | refreshIfNeeded () |
void | removeFileCaptureFilter () |
void | removeImageCapture () |
void | removeListener (CameraDevice::Listener *listenerToRemove) |
void | removeListener (CameraDevice::Listener *listenerToRemove) |
void | removeListener (CameraDevice::Listener *listenerToRemove) |
void | removeListener (CameraDevice::Listener *listenerToRemove) |
void | removeMovieCapture () |
void | removeUser () |
void | startRecordingToFile (const File &file, int) |
void | startRecordingToFile (const File &file, int) |
void | startRecordingToFile (const File &file, int quality) |
void | startRecordingToFile (const File &file, int) |
void | stopRecording () |
void | stopRecording () |
void | stopRecording () |
void | stopRecording () |
void | takeStillPicture (std::function< void(const Image &)> pictureTakenCallbackToUse) |
void | takeStillPicture (std::function< void(const Image &)> pictureTakenCallbackToUse) |
void | takeStillPicture (std::function< void(const Image &)> pictureTakenCallbackToUse) |
void | takeStillPicture (std::function< void(const Image &)> pictureTakenCallbackToUse) |
void | triggerImageCapture () |
Static Public Member Functions | |
static ComSmartPtr< IBaseFilter > | enumerateCameras (StringArray *names, const int deviceIndexToOpen) |
static StringArray | getAvailableDevices () |
static StringArray | getAvailableDevices () |
static StringArray | getAvailableDevices () |
static StringArray | getAvailableDevices () |
Public Attributes | |
Image | activeImage |
int | activeUsers = 0 |
ComSmartPtr< IBaseFilter > | asfWriter |
ComSmartPtr< GrabberCallback > | callback |
id< AVCaptureFileOutputRecordingDelegate > | callbackDelegate = nil |
ComSmartPtr< ICaptureGraphBuilder2 > | captureGraphBuilder |
AVCaptureView * | captureView = nil |
AVCaptureMovieFileOutput * | fileOutput = nil |
ComSmartPtr< IBaseFilter > | filter |
Time | firstPresentationTime |
Time | firstRecordedTime |
ComSmartPtr< IGraphBuilder > | graphBuilder |
DWORD | graphRegistrationID |
int | height = 0 |
Array< int > | heights |
bool | imageNeedsFlipping = false |
AVCaptureStillImageOutput * | imageOutput = nil |
CriticalSection | imageSwapLock |
bool | isRecording = false |
Image | loadingImage |
ComSmartPtr< IMediaControl > | mediaControl |
bool | openedSuccessfully = false |
String | openingError |
CriticalSection | pictureTakenCallbackLock |
int | previewMaxFPS = 60 |
bool | recordNextFrameTime = false |
ComSmartPtr< ISampleGrabber > | sampleGrabber |
AVCaptureSession * | session = nil |
ComSmartPtr< IBaseFilter > | smartTee |
ComSmartPtr< IPin > | smartTeeCaptureOutputPin |
ComSmartPtr< IPin > | smartTeePreviewOutputPin |
Array< ViewerComponent * > | viewerComps |
int | width = 0 |
Array< int > | widths |
Private Types | |
enum | { ERROR_CAMERA_IN_USE = 1, ERROR_MAX_CAMERAS_IN_USE = 2, ERROR_CAMERA_DISABLED = 3, ERROR_CAMERA_DEVICE = 4, ERROR_CAMERA_SERVICE = 5 } |
Static Private Member Functions | |
static String | cameraErrorCodeToString (int errorCode) |
static Rectangle< int > | chooseBestSize (int minWidth, int minHeight, int maxWidth, int maxHeight, Array< Rectangle< int >> supportedSizes) |
static String | cmTimeToString (CMTime time) |
static void | deleteMediaType (AM_MEDIA_TYPE *const pmt) |
static String | frameRateRangeToString (AVFrameRateRange *range) |
static NSArray< AVCaptureDevice * > * | getDevices () |
static String | getHighResStillImgDimensionsString (CMVideoDimensions d) |
static IOSVersion | getIOSVersion () |
static bool | getPin (IBaseFilter *filter, const PIN_DIRECTION wantedDirection, ComSmartPtr< IPin > &result, const char *pinName=nullptr) |
static LocalRef< jobject > | initialiseCameraCharacteristics (const GlobalRef &cameraManager, const String &cameraId) |
static LocalRef< jobject > | initialiseCameraManager () |
static Array< int > | jintArrayToJuceArray (const LocalRef< jintArray > &jArray) |
static void | printDebugCameraFormatInfo (AVCaptureDeviceFormat *format) |
static void | printDebugCameraInfo (AVCaptureDevice *device) |
static void | printDebugCameraInfo (const LocalRef< jobject > &cameraManagerToUse, const String &cameraId) |
static void | printPrimitiveArrayElements (const LocalRef< jobject > &keyValue, const String &keyName, const String &keyValueString) |
static void | printRangeArrayElements (const LocalRef< jobject > &rangeArray, const String &keyName) |
Private Attributes | |
GlobalRef | activityLifeListener |
bool | appWasPaused = false |
GlobalRef | cameraCharacteristics |
String | cameraId |
GlobalRef | cameraManager |
InternalOpenCameraResultCallback | cameraOpenCallback |
CaptureSession | captureSession |
std::unique_ptr< CaptureSessionModeBase > | currentCaptureSessionMode |
DeviceOrientationChangeListener | deviceOrientationChangeListener |
Time | firstRecordedFrameTimeMs |
GlobalRef | handler |
GlobalRef | handlerThread |
std::unique_ptr< ImageReader > | imageReader |
CriticalSection | listenerLock |
ListenerList< Listener > | listeners |
int | maxHeight |
int | maxWidth |
std::unique_ptr< MediaRecorder > | mediaRecorder |
int | minHeight |
int | minWidth |
bool | notifiedOfCameraOpening = false |
CameraDevice & | owner |
std::function< void(const Image &)> | pictureTakenCallback |
PreviewDisplay | previewDisplay |
std::unique_ptr< ScopedCameraDevice > | scopedCameraDevice |
StreamConfigurationMap | streamConfigurationMap |
Static Private Attributes | |
static IOSVersion | iosVersion = CameraDevice::Pimpl::getIOSVersion() |
Friends | |
struct | CameraDevice::ViewerComponent |
using CameraDevice::Pimpl::InternalOpenCameraResultCallback = std::function<void (const String& , const String& )> |
using CameraDevice::Pimpl::InternalOpenCameraResultCallback = std::function<void (const String& , const String& )> |
|
private |
|
inline |
|
inline |
References juce::getAppContext(), juce::getEnv(), and JUCE_DECLARE_WEAK_REFERENCEABLE.
|
inline |
|
inline |
References callbackDelegate, removeImageCapture(), removeMovieCapture(), and session.
|
inline |
References CLSID_NullRenderer, CLSID_SampleGrabber, and IID_ISampleGrabber.
|
inline |
|
inlineprivate |
|
inline |
References imageOutput, and session.
Referenced by refreshConnections().
|
inline |
References listenerLock, listeners, and triggerStillPictureCapture().
|
inline |
References listenerLock, listeners, and triggerImageCapture().
|
inline |
|
inline |
|
inline |
References fileOutput, and session.
Referenced by refreshConnections().
|
inline |
|
inline |
|
inlineprivate |
References listenerLock, and listeners.
|
inlineprivate |
|
inlineprivate |
|
inlinestaticprivate |
|
inlineprivate |
References JUCE_CAMERA_LOG.
Referenced by CameraDevice::Pimpl::ScopedCameraDevice::notifyOpenResult().
|
inline |
References JUCE_CAMERA_LOG, and owner.
|
inlineprivate |
|
inlineprivate |
References cameraId, cameraOpenCallback, and JUCE_CAMERA_LOG.
Referenced by CameraDevice::Pimpl::CaptureSession::cameraSessionStarted().
|
inlinestaticprivate |
References juce::Rectangle< ValueType >::getWidth(), and jassert.
|
inlinestaticprivate |
Referenced by frameRateRangeToString(), and printDebugCameraFormatInfo().
|
inlineprivate |
|
inline |
References juce::getAndroidSDKVersion(), juce::getAppContext(), and juce::getEnv().
References juce::jlimit(), and juce::numElementsInArray().
|
inlinestaticprivate |
References JUCE_DECLARE_NON_COPYABLE.
|
private |
|
inline |
|
inlinestatic |
|
inlinestaticprivate |
References cmTimeToString().
Referenced by printDebugCameraFormatInfo().
|
inlineprivate |
|
inlinestatic |
References getDevices(), JUCE_CAMERA_LOG, juce::nsStringToJuce(), and printDebugCameraInfo().
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlineprivate |
References juce::getEnv().
|
inlinenoexcept |
References cameraId.
|
inlinenoexcept |
|
inlineprivate |
Referenced by CameraDevice::Pimpl::ImageReader::onImageAvailable().
|
inlineprivate |
|
inlinestaticprivate |
References iosVersion, CameraDevice::Pimpl::IOSVersion::major, and CameraDevice::Pimpl::IOSVersion::minor.
Referenced by getAvailableDevices().
|
inlinestaticprivate |
Referenced by printDebugCameraFormatInfo().
|
inlinestaticprivate |
References int().
Referenced by CameraDevice::Pimpl::CaptureSession::StillPictureTaker::createCaptureOutput(), CameraDevice::Pimpl::CaptureSession::StillPictureTaker::PhotoOutputDelegateClass::PhotoOutputDelegateClass(), CameraDevice::Pimpl::CaptureSession::StillPictureTaker::printImageOutputDebugInfo(), CameraDevice::Pimpl::CaptureSession::VideoRecorder::startRecording(), CameraDevice::Pimpl::CaptureSession::StillPictureTaker::StillPictureTaker(), and CameraDevice::Pimpl::CaptureSession::StillPictureTaker::takePicture().
|
inlinestaticprivate |
|
inlineprivate |
References juce::getEnv().
|
inline |
|
inline |
References firstPresentationTime.
|
inline |
|
inline |
|
inline |
References imageOutput.
Referenced by refreshIfNeeded(), and triggerImageCapture().
|
inlineprivate |
|
inline |
|
inline |
References listenerLock, listeners, and triggerImageCapture().
Referenced by triggerImageCapture().
|
inlinestaticprivate |
|
inlinestaticprivate |
|
inlineprivate |
References JUCE_CAMERA_LOG.
|
inlinestaticprivate |
References juce::getEnv().
|
inlineprivate |
References JUCE_CAMERA_LOG, and pictureTakenCallback.
|
inlineprivate |
References JUCE_CAMERA_LOG.
Referenced by CameraDevice::Pimpl::CaptureSession::notifyPictureTaken().
|
inline |
|
inlineoverrideprivate |
|
inlineoverrideprivate |
|
inline |
|
inline |
References jassert.
|
inlinenoexcept |
References openingError.
|
inlinenoexcept |
References captureSession, and CameraDevice::Pimpl::CaptureSession::openedOk().
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinestaticprivate |
|
inlinestaticprivate |
|
inlinestaticprivate |
|
inlinestaticprivate |
References juce::getEnv(), juce::ignoreUnused(), JUCE_CAMERA_LOG, and PRINT_ELEMENTS.
|
inlinestaticprivate |
|
inline |
References addImageCapture(), addMovieCapture(), removeImageCapture(), removeMovieCapture(), and session.
Referenced by Pimpl(), and refreshIfNeeded().
|
inline |
References getVideoConnection(), and refreshConnections().
Referenced by startRecordingToFile(), and triggerImageCapture().
|
inline |
|
inlineprivate |
|
inline |
References imageOutput, and session.
Referenced by refreshConnections(), and ~Pimpl().
|
inline |
References listenerLock, and listeners.
|
inline |
References listenerLock, and listeners.
|
inline |
|
inline |
|
inline |
References fileOutput, and session.
Referenced by refreshConnections(), and ~Pimpl().
|
inline |
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
References jassert.
|
inline |
References captureSession, and CameraDevice::Pimpl::CaptureSession::startRecording().
|
inline |
|
inline |
|
inline |
References jassert, jassertfalse, and juce::jmin().
|
inlineprivate |
References jassert.
|
inlineprivate |
|
inline |
References captureSession, and CameraDevice::Pimpl::CaptureSession::stopRecording().
|
inline |
References fileOutput, isRecording, and stopRecording().
|
inline |
|
inline |
Referenced by startRecordingToFile(), and stopRecording().
|
inline |
References jassertfalse, pictureTakenCallback, and triggerStillPictureCapture().
|
inline |
References jassertfalse, pictureTakenCallback, and triggerImageCapture().
|
inline |
References jassert.
|
inline |
References jassertfalse.
|
inline |
References getVideoConnection(), handleImageCapture(), imageOutput, jassertfalse, JUCE_CAMERA_LOG, juce::nsStringToJuce(), and refreshIfNeeded().
Referenced by addListener(), handleImageCapture(), and takeStillPicture().
|
inlineprivate |
|
inlineprivate |
Referenced by addListener(), and takeStillPicture().
Image CameraDevice::Pimpl::activeImage |
int CameraDevice::Pimpl::activeUsers = 0 |
|
private |
|
private |
ComSmartPtr<IBaseFilter> CameraDevice::Pimpl::asfWriter |
ComSmartPtr<GrabberCallback> CameraDevice::Pimpl::callback |
id<AVCaptureFileOutputRecordingDelegate> CameraDevice::Pimpl::callbackDelegate = nil |
Referenced by Pimpl(), startRecordingToFile(), and ~Pimpl().
|
private |
|
private |
Referenced by cameraSessionStarted(), getCameraId(), open(), and triggerStillPictureCapture().
|
private |
|
private |
Referenced by cameraSessionRuntimeError(), cameraSessionStarted(), open(), and triggerStillPictureCapture().
ComSmartPtr<ICaptureGraphBuilder2> CameraDevice::Pimpl::captureGraphBuilder |
|
private |
Referenced by getTimeOfFirstRecordedFrame(), open(), openedOk(), startRecordingToFile(), and stopRecording().
AVCaptureView* CameraDevice::Pimpl::captureView = nil |
Referenced by Pimpl().
|
private |
|
private |
Referenced by CameraDevice::Pimpl::ImageReader::onImageAvailable().
AVCaptureMovieFileOutput* CameraDevice::Pimpl::fileOutput = nil |
Referenced by addMovieCapture(), removeMovieCapture(), startRecordingToFile(), and stopRecording().
ComSmartPtr<IBaseFilter> CameraDevice::Pimpl::filter |
Time CameraDevice::Pimpl::firstPresentationTime |
Referenced by getTimeOfFirstRecordedFrame(), and startRecordingToFile().
|
private |
Time CameraDevice::Pimpl::firstRecordedTime |
ComSmartPtr<IGraphBuilder> CameraDevice::Pimpl::graphBuilder |
DWORD CameraDevice::Pimpl::graphRegistrationID |
|
private |
|
private |
int CameraDevice::Pimpl::height = 0 |
Array<int> CameraDevice::Pimpl::heights |
bool CameraDevice::Pimpl::imageNeedsFlipping = false |
AVCaptureStillImageOutput* CameraDevice::Pimpl::imageOutput = nil |
Referenced by addImageCapture(), getVideoConnection(), removeImageCapture(), and triggerImageCapture().
|
private |
CriticalSection CameraDevice::Pimpl::imageSwapLock |
|
staticprivate |
Referenced by getDevices(), printDebugCameraFormatInfo(), and printDebugCameraInfo().
bool CameraDevice::Pimpl::isRecording = false |
Referenced by startRecordingToFile(), and stopRecording().
|
private |
Referenced by addListener(), callListeners(), handleImageCapture(), removeListener(), and triggerStillPictureCapture().
|
private |
Referenced by addListener(), callListeners(), handleImageCapture(), removeListener(), and triggerStillPictureCapture().
Image CameraDevice::Pimpl::loadingImage |
|
private |
|
private |
ComSmartPtr<IMediaControl> CameraDevice::Pimpl::mediaControl |
|
private |
|
private |
|
private |
|
private |
Referenced by cameraSessionRuntimeError().
bool CameraDevice::Pimpl::openedSuccessfully = false |
String CameraDevice::Pimpl::openingError |
Referenced by openedOk().
|
private |
Referenced by cameraSessionRuntimeError().
|
private |
Referenced by notifyPictureTaken(), takeStillPicture(), and triggerStillPictureCapture().
CriticalSection CameraDevice::Pimpl::pictureTakenCallbackLock |
|
private |
int CameraDevice::Pimpl::previewMaxFPS = 60 |
bool CameraDevice::Pimpl::recordNextFrameTime = false |
ComSmartPtr<ISampleGrabber> CameraDevice::Pimpl::sampleGrabber |
|
private |
AVCaptureSession* CameraDevice::Pimpl::session = nil |
Referenced by addImageCapture(), addMovieCapture(), Pimpl(), refreshConnections(), removeImageCapture(), removeMovieCapture(), and ~Pimpl().
ComSmartPtr<IBaseFilter> CameraDevice::Pimpl::smartTee |
ComSmartPtr<IPin> CameraDevice::Pimpl::smartTeeCaptureOutputPin |
ComSmartPtr<IPin> CameraDevice::Pimpl::smartTeePreviewOutputPin |
|
private |
Array<ViewerComponent*> CameraDevice::Pimpl::viewerComps |
int CameraDevice::Pimpl::width = 0 |
Array<int> CameraDevice::Pimpl::widths |