SDL 3.0
|
Go to the source code of this file.
Data Structures | |
struct | SDL_VideoCaptureSpec |
struct | SDL_VideoCaptureFrame |
Macros | |
#define | SDL_VIDEO_CAPTURE_ALLOW_ANY_CHANGE 1 |
Typedefs | |
typedef Uint32 | SDL_VideoCaptureDeviceID |
typedef struct SDL_VideoCaptureDevice | SDL_VideoCaptureDevice |
Enumerations | |
enum | SDL_VideoCaptureStatus { SDL_VIDEO_CAPTURE_FAIL = -1 , SDL_VIDEO_CAPTURE_INIT = 0 , SDL_VIDEO_CAPTURE_STOPPED , SDL_VIDEO_CAPTURE_PLAYING } |
Video Capture for the SDL library.
Definition in file SDL_video_capture.h.
#define SDL_VIDEO_CAPTURE_ALLOW_ANY_CHANGE 1 |
Definition at line 57 of file SDL_video_capture.h.
typedef struct SDL_VideoCaptureDevice SDL_VideoCaptureDevice |
Definition at line 55 of file SDL_video_capture.h.
typedef Uint32 SDL_VideoCaptureDeviceID |
This is a unique ID for a video capture device for the time it is connected to the system, and is never reused for the lifetime of the application. If the device is disconnected and reconnected, it will get a new ID.
The ID value starts at 1 and increments from there. The value 0 is an invalid ID.
Definition at line 48 of file SDL_video_capture.h.
SDL Video Capture Status
Change states but calling the function in this order:
SDL_OpenVideoCapture() SDL_SetVideoCaptureSpec() -> Init SDL_StartVideoCapture() -> Playing SDL_StopVideoCapture() -> Stopped SDL_CloseVideoCapture()
Enumerator | |
---|---|
SDL_VIDEO_CAPTURE_FAIL | Failed |
SDL_VIDEO_CAPTURE_INIT | Init, spec hasn't been set |
SDL_VIDEO_CAPTURE_STOPPED | Stopped |
SDL_VIDEO_CAPTURE_PLAYING | Playing |
Definition at line 90 of file SDL_video_capture.h.
|
extern |
Acquire a frame.
The frame is a memory pointer to the image data, whose size and format are given by the the obtained spec.
Non blocking API. If there is a frame available, frame->num_planes is non 0. If frame->num_planes is 0 and returned code is 0, there is no frame at that time.
After used, the frame should be released with SDL_ReleaseVideoCaptureFrame
device | opened video capture device |
frame | pointer to get the frame |
|
extern |
Use this function to shut down video_capture processing and close the video_capture device.
device | opened video capture device |
|
extern |
Number of available formats for the device
device | opened video capture device |
|
extern |
Number of different framesizes available for the device and pixel format.
device | opened video capture device |
format | frame pixel format (SDL_PixelFormatEnum) |
|
extern |
Get device name
instance_id | the video capture device instance ID |
|
extern |
Get a list of currently connected video capture devices.
count | a pointer filled in with the number of video capture devices |
|
extern |
Get frame format of video capture device.
The value can be used to fill SDL_VideoCaptureSpec structure.
device | opened video capture device |
index | format between 0 and num -1 |
format | pointer output format (SDL_PixelFormatEnum) |
|
extern |
Get frame sizes of the device and the specified input format.
The value can be used to fill SDL_VideoCaptureSpec structure.
device | opened video capture device |
format | a format that can be used by the device (SDL_PixelFormatEnum) |
index | framesize between 0 and num -1 |
width | output width |
height | output height |
|
extern |
Get the obtained video capture spec
device | opened video capture device |
spec | The SDL_VideoCaptureSpec to be initialized by this function. |
|
extern |
Get video capture status
device | opened video capture device |
|
extern |
Open a Video Capture device
instance_id | the video capture device instance ID |
|
extern |
Open a Video Capture device and set specification
instance_id | the video capture device instance ID |
desired | desired video capture spec |
obtained | obtained video capture spec |
allowed_changes | allow changes or not |
|
extern |
Release a frame.
Let the back-end re-use the internal buffer for video capture.
All acquired frames should be released before closing the device.
device | opened video capture device |
frame | frame pointer. |
|
extern |
Set specification
device | opened video capture device |
desired | desired video capture spec |
obtained | obtained video capture spec |
allowed_changes | allow changes or not |
|
extern |
Start video capture
device | opened video capture device |
|
extern |
Stop Video Capture
device | opened video capture device |