pub struct CGDisplayStreamUpdate { /* private fields */ }CGDisplayStream only.Expand description
An opaque reference to a single frame’s extra metadata that describes useful frame delta information
A CGDisplayStreamUpdate encapsulates information about what portions of a frame have changed relative to a previously delivered frame. This includes regions that were changed in any way, which ones were actually redrawn, and which regions were merely copied from one place to another. A routine is provided to merge two update refs together in cases where apps need to coalesce the values because they decided to skip processing for one or more frames.
See also Apple’s documentation
Implementations§
Source§impl CGDisplayStreamUpdate
impl CGDisplayStreamUpdate
Sourcepub unsafe fn rects(
update_ref: Option<&CGDisplayStreamUpdate>,
rect_type: CGDisplayStreamUpdateRectType,
rect_count: NonNull<usize>,
) -> *const CGRect
👎Deprecated: Please use ScreenCaptureKit instead.
pub unsafe fn rects( update_ref: Option<&CGDisplayStreamUpdate>, rect_type: CGDisplayStreamUpdateRectType, rect_count: NonNull<usize>, ) -> *const CGRect
Returns a pointer to an array of CGRect structs that describe what parts of the frame have changed relative to the previously delivered frame. This rectangle list encapsulates both the update rectangles and movement rectangles.
Parameter updateRef: The CGDisplayStreamUpdateRef
Parameter rectCount: A pointer to where the count of the number of rectangles in the array is to be returned. Must not be NULL.
Returns: A pointer to the array of CGRectangles. This array should not be freed by the caller.
§Safety
rect_count must be a valid pointer.
Sourcepub fn new_merged_update(
first_update: Option<&CGDisplayStreamUpdate>,
second_update: Option<&CGDisplayStreamUpdate>,
) -> Option<CFRetained<CGDisplayStreamUpdate>>
👎Deprecated: Please use ScreenCaptureKit instead.
pub fn new_merged_update( first_update: Option<&CGDisplayStreamUpdate>, second_update: Option<&CGDisplayStreamUpdate>, ) -> Option<CFRetained<CGDisplayStreamUpdate>>
Merge two CGDisplayUpdateRefs into a new one.
In cases where the client wishes to drop certain frame updates, this function may be used to merge two CGDisplayUpdateRefs together. The core bit of functionality here is generating a new set of refresh/move/dirty rectangle arrays that properly represent the union of the deltas between the two frames. Note that the ordering of the two refs is important.
Parameter firstUpdate: The first update (in a temporal sense)
Parameter secondUpdate: The second update (in a temporal sense)
Returns: The new CGDisplayStreamUpdateRef
Sourcepub unsafe fn moved_rects_delta(
update_ref: Option<&CGDisplayStreamUpdate>,
dx: NonNull<CGFloat>,
dy: NonNull<CGFloat>,
)
👎Deprecated: Please use ScreenCaptureKit instead.
pub unsafe fn moved_rects_delta( update_ref: Option<&CGDisplayStreamUpdate>, dx: NonNull<CGFloat>, dy: NonNull<CGFloat>, )
Return the movement dx and dy values for a single update
Parameter updateRef: The CGDisplayStreamUpdateRef
Parameter dx: A pointer to a CGFloat to store the x component of the movement delta
Parameter dy: A pointer to a CGFloat to store the y component of the movement delta
The delta values describe the offset from the moved rectangles back to the source location.
§Safety
dxmust be a valid pointer.dymust be a valid pointer.
Sourcepub fn drop_count(update_ref: Option<&CGDisplayStreamUpdate>) -> usize
👎Deprecated: Please use ScreenCaptureKit instead.
pub fn drop_count(update_ref: Option<&CGDisplayStreamUpdate>) -> usize
Return how many frames (if any) have been dropped since the last call to the handler.
Parameter updateRef: The CGDisplayStreamUpdateRef
Returns: The number of dropped frames
This call is primarily useful for performance measurement to determine if the client is keeping up with all WindowServer updates.
Methods from Deref<Target = CFType>§
Sourcepub fn downcast_ref<T>(&self) -> Option<&T>where
T: ConcreteType,
pub fn downcast_ref<T>(&self) -> Option<&T>where
T: ConcreteType,
Attempt to downcast the type to that of type T.
This is the reference-variant. Use CFRetained::downcast if you
want to convert a retained type. See also ConcreteType for more
details on which types support being converted to.
Sourcepub fn retain_count(&self) -> usize
pub fn retain_count(&self) -> usize
Get the reference count of the object.
This function may be useful for debugging. You normally do not use this function otherwise.
Beware that some things (like CFNumbers, small CFStrings etc.) may
not have a normal retain count for optimization purposes, and can
return usize::MAX in that case.
Trait Implementations§
Source§impl AsRef<AnyObject> for CGDisplayStreamUpdate
impl AsRef<AnyObject> for CGDisplayStreamUpdate
Source§impl AsRef<CFType> for CGDisplayStreamUpdate
impl AsRef<CFType> for CGDisplayStreamUpdate
Source§impl Borrow<AnyObject> for CGDisplayStreamUpdate
impl Borrow<AnyObject> for CGDisplayStreamUpdate
Source§impl Borrow<CFType> for CGDisplayStreamUpdate
impl Borrow<CFType> for CGDisplayStreamUpdate
Source§impl ConcreteType for CGDisplayStreamUpdate
impl ConcreteType for CGDisplayStreamUpdate
Source§impl Debug for CGDisplayStreamUpdate
impl Debug for CGDisplayStreamUpdate
Source§impl Deref for CGDisplayStreamUpdate
impl Deref for CGDisplayStreamUpdate
Source§impl Hash for CGDisplayStreamUpdate
impl Hash for CGDisplayStreamUpdate
Source§impl Message for CGDisplayStreamUpdate
impl Message for CGDisplayStreamUpdate
Source§impl PartialEq for CGDisplayStreamUpdate
impl PartialEq for CGDisplayStreamUpdate
Source§impl RefEncode for CGDisplayStreamUpdate
impl RefEncode for CGDisplayStreamUpdate
Source§const ENCODING_REF: Encoding
const ENCODING_REF: Encoding
Source§impl Type for CGDisplayStreamUpdate
impl Type for CGDisplayStreamUpdate
Source§fn retain(&self) -> CFRetained<Self>where
Self: Sized,
fn retain(&self) -> CFRetained<Self>where
Self: Sized,
Source§fn as_concrete_TypeRef(&self) -> &Self
fn as_concrete_TypeRef(&self) -> &Self
core-foundation crate.Source§unsafe fn wrap_under_get_rule(ptr: *const Self) -> CFRetained<Self>where
Self: Sized,
unsafe fn wrap_under_get_rule(ptr: *const Self) -> CFRetained<Self>where
Self: Sized,
core-foundation crate. Read moreSource§fn as_CFTypeRef(&self) -> &CFType
fn as_CFTypeRef(&self) -> &CFType
core-foundation crate.Source§unsafe fn wrap_under_create_rule(ptr: *const Self) -> CFRetained<Self>where
Self: Sized,
unsafe fn wrap_under_create_rule(ptr: *const Self) -> CFRetained<Self>where
Self: Sized,
core-foundation crate. Read more