📄 slicedccpin.cpp
字号:
/*+++ *******************************************************************\
*
* Copyright and Disclaimer:
*
* ---------------------------------------------------------------
* This software is provided "AS IS" without warranty of any kind,
* either expressed or implied, including but not limited to the
* implied warranties of noninfringement, merchantability and/or
* fitness for a particular purpose.
* ---------------------------------------------------------------
*
* Copyright (c) 2008 Conexant Systems, Inc.
* All rights reserved.
*
\******************************************************************* ---*/
#include "SlicedCCPin.h"
#include "debug.h"
#include "device.h"
#include "miscfuncs.h"
const ULONG SLICED_CC_FRAMES_TO_CYCLE = 8;
/////////////////////////////////////////////////////////////////////////////////////////
SlicedCCPin::SlicedCCPin(
PKSPIN p_ks_pin,
NTSTATUS &status):
BasePin(p_ks_pin)
{
// Init the base class
status = init(
SLICED_CC_FRAMES_TO_CYCLE,
2, //buffer size
0); //duration
}
/////////////////////////////////////////////////////////////////////////////////////////
SlicedCCPin::~SlicedCCPin()
{
}
/////////////////////////////////////////////////////////////////////////////////////////
NTSTATUS SlicedCCPin::dispatchCreate(
PKSPIN p_ks_pin,
PIRP p_irp)
{
NTSTATUS status = STATUS_SUCCESS;
Device* p_device = getDevice(p_irp);
if(!p_device)
{
return STATUS_UNSUCCESSFUL;
}
p_ks_pin->Context = new SlicedCCPin(p_ks_pin, status);
if(!p_ks_pin->Context)
{
return STATUS_INSUFFICIENT_RESOURCES;
}
if(!NT_SUCCESS(status))
{
delete (SlicedCCPin*)p_ks_pin->Context;
}
return status;
}
/////////////////////////////////////////////////////////////////////////////////////////
VOID SlicedCCPin::fillFrameInfo(PKSSTREAM_HEADER p_strm_hdr, FIELD_TYPE field_type)
{
}
/////////////////////////////////////////////////////////////////////////////////////////
NTSTATUS SlicedCCPin::static_IntersectHandler(
PKSFILTER p_filter,
PIRP p_irp,
PKSP_PIN p_pin_instance,
PKSDATARANGE p_caller_data_range, //data range to verify.
PKSDATARANGE p_descriptor_data, //Our data range
ULONG buffer_size,
PVOID p_data,
PULONG p_data_size)
{
ASSERT(p_filter);
ASSERT(p_irp);
ASSERT(p_pin_instance);
ASSERT(p_caller_data_range);
ASSERT(p_descriptor_data);
ASSERT(p_data_size);
//If buffer_size is 0, the user just wants the size.
if(buffer_size == 0)
{
*p_data_size = sizeof(KSDATAFORMAT);
return STATUS_BUFFER_OVERFLOW;
}
if(buffer_size < sizeof(KSDATAFORMAT))
{
return STATUS_BUFFER_TOO_SMALL;
}
//Copy the data format into the buffer.
RtlCopyMemory(
p_data,
p_descriptor_data,
sizeof(KSDATAFORMAT));
return STATUS_SUCCESS;
}
/////////////////////////////////////////////////////////////////////////////////////////
PIN_TYPES SlicedCCPin::getPinType()
{
return PIN_TYPE_SLICED_CC;
}
/////////////////////////////////////////////////////////////////////////////////////////
const KSPIN_DISPATCH g_sliced_cc_pin_dispatch =
{
SlicedCCPin::dispatchCreate, // Pin Create
BasePin::dispatchClose, // Pin Close
BasePin::dispatchProcess, // Pin Process
NULL, // Pin Reset
NULL, // Pin Set Data Format
BasePin::dispatchSetState, // Pin Set Device State
NULL, // Pin Connect
NULL, // Pin Disconnect
NULL, // Clock Dispatch
NULL // Allocator Dispatch
};
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -