EVT_ACX_STREAMAUDIOENGINE_ASSIGN_LAST_BUFFER_POSITION callback function (acxelements.h)

The EVT_ACX_STREAMAUDIOENGINE_ASSIGN_LAST_BUFFER_POSITION callback function is implemented by the driver and is called when the position of the last valid byte in the audio buffer is set for the specified stream audio engine.

Syntax

EVT_ACX_STREAMAUDIOENGINE_ASSIGN_LAST_BUFFER_POSITION EvtAcxStreamaudioengineAssignLastBufferPosition;

NTSTATUS EvtAcxStreamaudioengineAssignLastBufferPosition(
  ACXSTREAMAUDIOENGINE StreamAudioEngine,
  ULONG Position
)
{...}

Parameters

StreamAudioEngine

An existing, initialized, ACXSTREAMAUDIOENGINE object. For more information about ACX objects, see Summary of ACX Objects.

Position

Indicates the position of the last valid byte in the audio buffer of the specified stream audio engine. For more information on the position value, see KSPROPERTY_AUDIO_WAVERT_CURRENT_WRITE_LASTBUFFER_POSITION.

Return value

Returns STATUS_SUCCESS if the call was successful. Otherwise, it returns an appropriate error code. For more information, see Using NTSTATUS Values.

Remarks

Example

Example usage is shown below.

EVT_ACX_STREAMAUDIOENGINE_ASSIGN_LAST_BUFFER_POSITION       CodecR_EvtAcxStreamAudioEngineAssignLastBufferPosition;

NTSTATUS
CodecR_EvtAcxStreamAudioEngineAssignLastBufferPosition(
    _In_    ACXSTREAMAUDIOENGINE    StreamAudioEngine,
    _In_    ULONG                   Position
)
{
    NTSTATUS status = STATUS_INVALID_PARAMETER;
    ACXSTREAM stream;
    PCODEC_STREAM_CONTEXT ctx;
    CRenderStreamEngine * streamEngine = NULL;

    PAGED_CODE();

    stream = AcxStreamAudioEngineGetStream(StreamAudioEngine);
    if (stream)
    {
        ctx = GetCodecStreamContext(stream);

        streamEngine = static_cast<CRenderStreamEngine*>(ctx->StreamEngine);

        status = streamEngine->SetLastBufferPosition(Position);
    }

    return status;
}

ACX requirements

Minimum ACX version: 1.0

For more information about ACX versions, see ACX version overview.

Requirements

Requirement Value
Header acxelements.h
IRQL PASSIVE_LEVEL

See also