Class JPEGCallbackVideoView
- Namespace
- VisioForge.Core.UI
- Assembly
- VisioForge.Core.dll
A headless video view implementation that provides JPEG-encoded frame callbacks without visual rendering.
This class serves as a specialized callback-based video sink that receives video frames pre-encoded as JPEG images and forwards them to event handlers. Unlike VisioForge.Core.UI.CallbackVideoView which delivers raw pixel data, JPEGCallbackVideoView provides ready-to-use JPEG byte arrays, eliminating the need for frame encoding in subscriber code. Ideal for scenarios requiring JPEG images without UI rendering, such as motion JPEG streaming, snapshot systems, or web-based video delivery.
Key features:
- Receives pre-encoded JPEG frame data as byte arrays
- Implements VisioForge.Core.Types.IVideoView for standard video view integration
- Provides OnJPEGFrame event for JPEG data processing
- No-op implementations of UI-specific methods (rendering, mouse events, etc.)
- Platform-independent operation without UI dependencies
- Zero encoding overhead - frames arrive already JPEG-compressed
- Memory-efficient delivery of compressed frame data
Common use cases:
- Motion JPEG (MJPEG) streaming servers
- Snapshot capture and storage systems
- Web-based video monitoring dashboards
- Network camera integration with JPEG output
- Thumbnail generation for video content
- Low-bandwidth video transmission scenarios
- REST API video frame endpoints
Threading considerations:
- Frame callbacks occur on the media pipeline thread
- JPEG data is ready for immediate network transmission or file storage
- Subscribers should handle data quickly or queue for background processing
- No UI thread synchronization overhead
Performance characteristics:
- Minimal memory allocation per frame
- No rendering or encoding overhead
- Compressed data reduces memory and network bandwidth requirements
- JPEG quality and compression ratio configured at source level
public class JPEGCallbackVideoView : IVideoViewInheritance
Implements
Inherited Members
Methods
CallInvoke(Delegate, params object[])
Invokes a delegate method. Not implemented.
public void CallInvoke(Delegate method, params object[] args)Parameters
CallRefresh()
Refreshes the view. Not implemented.
public void CallRefresh()ClearUI()
Clears the UI. Not implemented.
public void ClearUI()GetBackgroundColor()
Gets the background color.
public SKColor GetBackgroundColor()Returns
- SKColor
-
Always returns black.
GetHandle()
Gets the window handle.
public nint GetHandle()Returns
- nint
-
Always returns IntPtr.Zero.
GetInvokeRequired()
Gets whether invoke is required.
public bool GetInvokeRequired()Returns
- bool
-
Always returns false.
GetIsHandleCreated()
Gets whether the handle is created.
public bool GetIsHandleCreated()Returns
- bool
-
Always returns false.
GetSize()
Gets the size of the view.
public Size GetSize()Returns
- Size
-
Always returns Size(0, 0).
GetUIEngine()
Gets the UI engine type.
public VideoViewUIEngine GetUIEngine()Returns
- VideoViewUIEngine
-
Returns JPEGCallback.
InvokeStart()
Invokes start operation. Not implemented.
public void InvokeStart()InvokeStartComplete()
Invokes start complete operation. Not implemented.
public void InvokeStartComplete()InvokeStop()
Invokes stop operation. Not implemented.
public void InvokeStop()InvokeVideoRendererUpdate()
Invokes video renderer update. Not implemented.
public void InvokeVideoRendererUpdate()LogDialogClear()
Clears the log dialog. Not implemented.
public void LogDialogClear()LogDialogClose()
Closes the log dialog. Not implemented.
public void LogDialogClose()LogDialogError(string)
Logs an error message in dialog. Not implemented.
public void LogDialogError(string msg)Parameters
msgstring-
The error message.
PushMouseButtonDown(int, int, MouseButton)
Pushes a mouse button down event. Not implemented.
public void PushMouseButtonDown(int x, int y, MouseButton button)Parameters
xint-
The x coordinate.
yint-
The y coordinate.
buttonMouseButton-
The mouse button.
PushMouseButtonUp(int, int, MouseButton)
Pushes a mouse button up event. Not implemented.
public void PushMouseButtonUp(int x, int y, MouseButton button)Parameters
xint-
The x coordinate.
yint-
The y coordinate.
buttonMouseButton-
The mouse button.
PushMouseMove(int, int)
Pushes a mouse move event. Not implemented.
public void PushMouseMove(int x, int y)Parameters
ResizeRoundTo(int)
Resizes the view rounded to specified value. Not implemented.
public void ResizeRoundTo(int round)Parameters
roundint-
The rounding value.
SetHandle(nint)
Sets the window handle. Not implemented.
public void SetHandle(nint handle)Parameters
handlenint-
The window handle.
ShowMessage(string)
Shows a message box. Not implemented.
public MessageBoxResult ShowMessage(string message)Parameters
messagestring-
The message to display.
Returns
- MessageBoxResult
-
Always returns None.
OnJPEGFrame
Occurs when a new JPEG-encoded video frame is available for processing.
This event is the primary mechanism for receiving JPEG-compressed video frames in JPEGCallbackVideoView. Subscribers receive byte arrays containing complete JPEG image data, ready for storage, transmission, or further processing. The event is raised on the media pipeline thread.
Event handling guidelines:
- JPEG data is complete and valid for immediate use
- Frame data can be directly written to files, network streams, or HTTP responses
- Process frames quickly or queue for background processing to avoid blocking the pipeline
- Byte array remains valid only during the event handler execution
- Copy data if processing will occur asynchronously
The byte array parameter contains:
- Complete JPEG file data including headers
- Compressed image data ready for storage or transmission
- Quality and compression configured at the media source level
- No additional encoding required
Common usage patterns:
- Stream to HTTP response for web viewing
- Save to file for snapshot capture
- Transmit over network for MJPEG streaming
- Queue for batch processing or archival
- Forward to REST API endpoints
Thread safety: Event is raised on media pipeline thread, not UI thread. Subscribers must handle thread synchronization if updating UI components.
Performance: JPEG data is pre-encoded by the media pipeline. Frame size varies based on content complexity and configured quality settings.
public event EventHandler<byte[]> OnJPEGFrameEvent Type
- EventHandler<byte[]>
OnMouseButtonDown
Occurs when a mouse button is pressed down on the video view.
Note: This event is never raised in JPEGCallbackVideoView as it has no visual representation. It exists for interface compliance with VisioForge.Core.Types.IVideoView. Mouse events are only functional in platform-specific video views with UI rendering.
public event EventHandler<MouseButtonEventArgs> OnMouseButtonDownEvent Type
OnMouseButtonUp
Occurs when a mouse button is released on the video view.
Note: This event is never raised in JPEGCallbackVideoView as it has no visual representation. It exists for interface compliance with VisioForge.Core.Types.IVideoView. Mouse events are only functional in platform-specific video views with UI rendering.
public event EventHandler<MouseButtonEventArgs> OnMouseButtonUpEvent Type
OnMouseMoved
Occurs when the mouse cursor is moved over the video view.
Note: This event is never raised in JPEGCallbackVideoView as it has no visual representation. It exists for interface compliance with VisioForge.Core.Types.IVideoView. Mouse events are only functional in platform-specific video views with UI rendering.
public event EventHandler<MouseMoveEventArgs> OnMouseMoved