Skip to content

media sdk camera blocking

Andre Lafleur edited this page Oct 8, 2026 · 8 revisions

About camera blocking

Camera blocking is a Security Center access control that hides live or recorded video from specific users or security levels. When a camera is blocked for a user, the Media SDK still delivers an event for each frame, but the frame content is not available to that user.

Camera blocking is configured outside the Media SDK. The Media SDK exposes APIs that evaluate blocking state and react to it. Each Media SDK component provides different blocking information, and an integration must handle blocking on every component it uses.

Where blocking shows up

SDK type or member Question it answers Use
LiveBlockingConfiguration.IsLiveBlocked Is live video blocked for this camera and user, right now? Pre-flight check before starting a live-video action
MediaPlayer.StreamingConnectionStatus Is the stream the player is showing blocked right now? Check for StreamingConnectionStatus.Blocked; subscribe to StreamingConnectionStatusChanged
FrameDecodedEventArgs.IsBlocked Did a decoded frame arrive without content because video is blocked? Inside a VideoSourceFilter or AudioVideoSourceFilter frame handler
BlockCameraUpdated event + MediaBlockingConfiguration Did the blocking configuration change while the source filter was running? Subscribe on the source filter
MediaBlockingConfiguration.IsBlocked(DateTime, byte) Is video blocked at a specific time for a given security level? Inside the BlockCameraUpdated handler
MediaBlockingConfiguration.CanBlockUnblock(DateTime, byte) Can this security level block or unblock video at this time? Gate block/unblock UI commands
AnalogMonitorController.BlockedCameraRequested Did the analog monitor try to display a blocked camera? Subscribe on AnalogMonitorController

Each of these is independent. An integration can run a pre-flight IsLiveBlocked check, subscribe to BlockCameraUpdated while playing back, and still need to handle IsBlocked on individual frames.

LiveBlockingConfiguration

Use LiveBlockingConfiguration for a one-shot live-video blocking decision against a specific user.

using Genetec.Sdk.Media;

var blocking = new LiveBlockingConfiguration(engine);

bool isBlocked = blocking.IsLiveBlocked(cameraGuid, userGuid);

IsLiveBlocked returns true when live video is blocked for the camera and user. If an existing LiveBlockingConfiguration is used after the engine disconnects from the Directory, IsLiveBlocked also returns true; the integration cannot prove the camera is unblocked, so the API treats it as blocked. If LiveBlockingConfiguration is created while the engine is not connected to a Directory, the constructor can fail before IsLiveBlocked runs.

IsLiveBlocked requires a camera identifier and a user identifier that resolve to entities the logged-on user can access. Resolve the camera and user entities before calling IsLiveBlocked.

Run this check before starting a live workflow that should not begin when video is blocked. It does not subscribe to changes; for ongoing blocking awareness during a session, use BlockCameraUpdated on the source filter.

MediaPlayer

MediaPlayer reports blocking through StreamingConnectionStatus: the value is StreamingConnectionStatus.Blocked while video is blocked for the logged-on user. Read the property for a point-in-time check, or subscribe to StreamingConnectionStatusChanged to react while the player is running. VideoSourceFilter and AudioVideoSourceFilter expose the same property and event.

FrameDecodedEventArgs.IsBlocked

When VideoSourceFilter or AudioVideoSourceFilter is running and the camera becomes blocked for the current user, frames continue to arrive but e.IsBlocked is true and e.DecodedFrameContent is null.

private static void OnFrameDecoded(
    object sender,
    FrameDecodedEventArgs e)
{
    using (e)
    {
        if (e.IsBlocked)
        {
            ShowBlockedVideoState(e.FrameTime);
            return;
        }

        ProcessFrame(e.DecodedFrameContent);
    }
}

A blocked frame is an access decision, not a missing image. Show a message that explains the video is blocked instead of leaving the area empty.

BlockCameraUpdated and MediaBlockingConfiguration

VideoSourceFilter raises BlockCameraUpdated when the camera's blocking configuration changes during playback. AudioVideoSourceFilter inherits this behavior. The event argument carries a MediaBlockingConfiguration that can evaluate blocking rules for a UTC timestamp and a security level.

VideoSourceFilter filter = new VideoSourceFilter();
filter.Initialize(engine, cameraGuid);
filter.BlockCameraUpdated += OnBlockCameraUpdated;
filter.PlayLive();

Set userLevel to the security level you want to evaluate. For a specific Security Center user and camera, get the value from the user entity with user.GetSecurityLevelForCamera(cameraGuid).

For the blocking range at the requested timestamp, IsBlocked returns true when the user's security-level number is greater than the blocking-level number. For example, with a blocking level of 10, user level 10 is not blocked and user level 11 is blocked.

private static void OnBlockCameraUpdated(
    object sender,
    BlockCameraUpdatedEventArgs e)
{
    bool isBlocked = e.Configuration.IsBlocked(
        DateTime.UtcNow,
        userLevel);

    UpdateBlockedState(isBlocked);
}
MediaBlockingConfiguration member Description
IsBlocked(DateTime timestamp, byte userLevel) Returns true when video is blocked at the given UTC time for the given security level.
CanBlockUnblock(DateTime timestamp, byte userLevel) Returns true when the security level is allowed to block or unblock video at the given UTC time.
Merge(MediaBlockingConfiguration other) Combines two configurations into one. Use when the integration subscribes to BlockCameraUpdated on multiple filters and needs a single evaluation.

AnalogMonitorController.BlockedCameraRequested

Analog monitor playback runs through AnalogMonitorController, not through MediaPlayer or a source filter. Blocking on that path shows up as a separate event:

Event Args
AnalogMonitorController.BlockedCameraRequested CameraBlockedEventArgs carries AnalogMonitorId, CameraId, UserId, and BlockLevel.

Set AnalogMonitorController.CameraBlockingUserId to choose which Security Center user's blocking rules the controller evaluates against. For the rest of the analog-monitor workflow, see AnalogMonitorController.

See also

Platform SDK

Plugin SDK

Workspace SDK

Media SDK

Macro SDK

Web SDK

Synergis RIO

Media Gateway

Genetec Web Player

Clone this wiki locally