Jump to content

Type library for SkyStar2 driver


HuRN

Recommended Posts

Good day! From Russia with... question :) Sorry for my English first. Well, i'm interesting in SkyStar2 API, but can't use *.h-files from B2C2 SDK because

working in Delphi. Translating this files to pascal cause some errors and i can't

understand the reason. May be my brain is in strong pressure of vodka and frost :) But i still can use standart typelibrary (*.tlb will be great!) - it's quite simple even for me. Good people in B2C2 tell me the DVBViewer written in Delphi. So, you can help me, i think.

Thank you in advance.

Link to comment

Well, it's some work, but not so difficult. First of all, you'll need DSPack from

 

http://www.progdigy.com/modules.php?name=DSPack

 

that contains the Delphi translation of the MS DirectShow header files. And, of course, some basic experience with DirectShow programming.

 

Your B2C2 SDK translation should look like this (just a short example):

 

unit MyB2C2Unit;

interface 

uses 
 directshow9, windows; //directshow9.pas from DSPack!

const
 CLSID_B2C2MPEG2Filter: TGuid = '{E82536A0-94DA-11d2-A463-00A0C95D308D}';
 IID_IB2C2MPEG2TunerCtrl: TGuid = '{D875D4A9-0749-4fe8-ADB9-CC13F9B3DD45}';
 IID_IB2C2MPEG2TunerCtrl2: TGuid = '{CD900832-50DF-4f8f-882D-1C358F90B3F2}';
 //etc.

type
 IB2C2MPEG2TunerCtrl = interface(IUnknown)
   ['{D875D4A9-0749-4fe8-ADB9-CC13F9B3DD45}']
   function SetFrequency(dwSetFrequency: DWord): HResult; stdcall;
   function SetSymbolRate(dwSetSymbolRate: DWord): HResult; stdcall;
 //etc.
 end;

 IB2C2MPEG2TunerCtrl2 = interface(IB2C2MPEG2TunerCtrl)
   ['{CD900832-50DF-4f8f-882D-1C358F90B3F2}']
   function SetTunerStatusEx(dwTunerStatusEx: DWord): HResult; stdcall;
 //etc.
 end;

 //etc.

end;

Link to comment
Well, it's some work, but not so difficult. First of all, you'll need DSPack from

 

Thanks a lot! I'll be working on this. And i see the reason of my translation errors, for my mind. It just a stdcall declaration - so simple and obviously... :)

Link to comment

I'm already on work and have one offtopic question, if you don't object. My application can use GetTunerCapabilities from IB2C2MPEG2TunerCtrl interface properly, but such methods like GetSNR, GetFrequency, GetSignalQuality and other Get-methods always return zero (Even supported by tuner, like GetSignalQuality on SkyStar2). Can you write short example declaration of this type of function (with return parameter)? Please. My declaration look like this:

 

 IB2C2MPEG2TunerCtrl = interface(IUnknown)
 ['{D875D4A9-0749-4fe8-ADB9-CC13F9B3DD45}']
...
 function GetSignalStrength(var plSignalStrength:DWORD):HRESULT;stdcall;
...
 function GetSNR(var pfSNR:Single):HRESULT;stdcall;
...

 

Is it right?

Link to comment
  • 2 years later...
unit SkyStar2;

interface
uses
Windows, SysUtils, Classes, Messages,B2C2SDK,directshow9,DSUtil,ActiveX,ComObj;

const
 MAX_FILTER_COUNT = 39;
 BUF_SIZE = 4096;
 PACKET_SIZE =188;
 PACKET_NUM =1;

type
 LPCB_STREAMHOOK = procedure(FilterID: Dword;Len: Cardinal;Buf: PByteArray); stdcall;

type
 TFilter =record
Active: Boolean;
Pid:integer;
CallBackFunction: LPCB_STREAMHOOK;
 end;

var
GraphBuilder	   : IGraphBuilder		= nil;
MediaControl	   : IMediaControl		= nil;
B2C2MPEG2Filter	: IBaseFilter		  = nil;
B2C2MPEG2TunerCtrl : IB2C2MPEG2TunerCtrl2 = nil;
B2C2MPEG2DataCtrl  : IB2C2MPEG2DataCtrl5  = nil;
RotEntry		   : integer;
Signal_Strengths_Sup: BOOL = False;
Signal_Quality_Sup: BOOL = False;
Signal_BER_Sup: BOOL = False;

Fcount			  :cardinal = 1;
Filters:array[0..MAX_FILTER_COUNT-1] of TFilter;

implementation

function ProcessCallback(wPID: WORD; pucTransportPacket :PByteArray):UINT; stdcall;
var
i:integer;
begin
{ Form1.PushData(@pucTransportPacket[0], 188);  }
for i:=0 to MAX_FILTER_COUNT-1 do
 if (Filters[i].Active)and(Filters[i].PID=wPID)  then
 begin
 Filters[i].CallBackFunction(i+1,188,@pucTransportPacket[0]);
 end;
result:=0;
end;

function GetPin_(pFilter:IBaseFilter; Name:string;var ppPin :IPin):HRESULT;
var
 hr: HRESULT;
  PEnum:IEnumPins;
 pPinOut:IPin;
 pInfo:TPinInfo;
 s : string;
begin
Result :=S_FALSE;
  hr :=pFilter.EnumPins(pEnum);
	if (hr <> S_OK) then
	begin

	  Result :=  S_FALSE;
	  Exit;
	end;
 while pEnum.Next(1, pPinOut, NIL)=S_OK do
begin
  hr:= pPinOut.QueryPinInfo(pInfo);
  if pInfo.pFilter<>nil then pInfo.pFilter:=nil;
  if SUCCEEDED(hr) then
	begin
	  if (pInfo.dir = PINDIR_OUTPUT) then
		begin
		  s:= pInfo.achName;

		 if s=Name then begin
			ppPin := pPinOut;
			Result :=S_OK;

		 end;
	   pPinOut:=nil;
	   if (ppPin<>nil) then Break;
		end;
	end
end;
 pPinOut:=nil;
 pEnum := nil;

end;

function StartDVB(): BOOL; stdcall;
var
hr:HRESULT;
TunerCaps: TTunerCapabilities;
TunerCapsSize: dword;
OutPin :IPin;
begin
 If failed(CoInitialize(NIL)) then Exit;
  if  CoCreateInstance(CLSID_FilterGraph, nil, CLSCTX_INPROC, IID_IGraphBuilder, GraphBuilder) = S_OK then
  begin
 AddGraphToRot( GraphBuilder, RotEntry);
 GraphBuilder.QueryInterface(IID_IMediaControl, MediaControl);

   if  CoCreateInstance(CLSID_B2C2MPEG2Filter, nil, CLSCTX_INPROC_SERVER, IID_IBaseFilter, B2C2MPEG2Filter)= S_OK then
	begin
	 GraphBuilder.AddFilter( B2C2MPEG2Filter, StringToOleStr('B2C2Filter'));
	 B2C2MPEG2Filter.QueryInterface(IID_IB2C2MPEG2TunerCtrl2, B2C2MPEG2TunerCtrl);
	 B2C2MPEG2Filter.QueryInterface(IID_IB2C2MPEG2DataCtrl5, B2C2MPEG2DataCtrl);
	 B2C2MPEG2TunerCtrl.Initialize;
	 B2C2MPEG2TunerCtrl.CheckLock;
	 TunerCapsSize:=SizeOf(TTunerCapabilities);
	 B2C2MPEG2TunerCtrl.GetTunerCapabilities(tunerCaps,TunerCapsSize);
	 Signal_Quality_Sup :=tunerCaps.dwPerformanceMonitoring and SIGNAL_QUALITY_SUPPORTED >0;
	 Signal_Strengths_Sup :=tunerCaps.dwPerformanceMonitoring and SIGNAL_STRENGTH_SUPPORTED>0;
	 Signal_BER_Sup :=tunerCaps.dwPerformanceMonitoring and BER_SUPPORTED>0;
	 B2C2MPEG2DataCtrl.SetCallbackForTransportStream(@ProcessCallback);
	end;
  Result:=True;
  MediaControl.run;
 end
 else
 Result:=false;
end;
exports StartDVB name 'StartDVB';

procedure StopDVB();stdcall;
begin
 if Assigned(GraphBuilder) then
 begin
MediaControl.Stop;
RemoveGraphFromRot(RotEntry);
MediaControl := nil;
GraphBuilder := nil;
 end;

if Assigned(B2C2MPEG2Filter) then
 begin
B2C2MPEG2DataCtrl.SetCallbackForTransportStream(nil);
B2C2MPEG2TunerCtrl := nil;
B2C2MPEG2DataCtrl  := nil;
B2C2MPEG2Filter := nil;
 end;
 CoUninitialize;
end;
exports StopDVB name 'StopDVB';

function SetChannel(DiseqC:DWORD;Freq:DWORD; smyb: DWORD; pol: DWORD;fec: DWORD; lof1 :DWORD; lof2 :DWORD; lofsw :DWORD): BOOL;stdcall;
var
lof:integer;
lnb:integer;
Hr:HRESULT;
begin
if assigned(B2C2MPEG2Filter) then begin

if(freq < lofsw)then
 begin
lof := lof1;
lnb := LNB_SELECTION_0;
 end
 else
  begin
 lof := lof2;
 lnb := LNB_SELECTION_22;
  end;
  // B2C2MPEG2TunerCtrl.Initialize;
  hr :=  B2C2MPEG2TunerCtrl.SetDiseqc(DiseqC);
  if FAILED(hr) then  begin  result:=false; exit; end;
hr :=  B2C2MPEG2TunerCtrl.SetFrequencyKHz(freq);
if FAILED(hr) then begin  result:=false; exit; end;
hr :=  B2C2MPEG2TunerCtrl.SetSymbolRate(smyb div 1000);
 if FAILED(hr) then begin  result:=false; exit;  end;
hr :=  B2C2MPEG2TunerCtrl.SetLnbFrequency(lof div 1000);
if FAILED(hr) then begin  result:=false; exit; end;
hr :=  B2C2MPEG2TunerCtrl.SetFec(FEC_AUTO);
 if FAILED(hr) then begin  result:=false; exit; end;
hr :=  B2C2MPEG2TunerCtrl.SetPolarity(pol);
 if FAILED(hr) then begin  result:=false; exit; end;
hr :=  B2C2MPEG2TunerCtrl.SetLnbKHz(lnb);
if FAILED(hr) then begin  result:=false; exit; end;

hr :=  B2C2MPEG2TunerCtrl.SetTunerStatus();
if FAILED(hr) then begin  result:=false; exit; end;
hr :=  B2C2MPEG2TunerCtrl.CheckLock();
 if FAILED(hr) then begin  result:=false; exit; end;

 result:=true;
 end;
end;
exports SetChannel name 'SetChannel';


function SetFilter(wPID:Word;StreamHook: LPCB_STREAMHOOK): Dword; stdcall;
var
hr: HRESULT;
i:integer;
begin
for i:=0 to MAX_FILTER_COUNT-1  do
if not Filters[i].Active then
with Filters[i] do
begin
  CallBackFunction:=StreamHook;
  PID:=wPID;

  hr:= B2C2MPEG2DataCtrl.AddTsPIDs(Fcount,@PID);
	if (FAILED (hr)) then begin
	   Active := FALSE;
	   CallBackFunction := nil;
	   PID := 0;
	   result :=0;
	   exit;
	   end;
  Active:=True;
  result:=i+1;
  exit;
  end;
 result:=0;
 exit;

end;
exports SetFilter name 'SetFilter';

function DelFilter(FilterID: Dword): BOOL;stdcall;
begin
 if(FilterID > 0) and (FilterID <= MAX_FILTER_COUNT-1) then begin
  if (Filters[FilterID-1].Active)  then
begin
   Filters[FilterID-1].Active:=False;
   Filters[FilterID-1].CallBackFunction:=nil;
   B2C2MPEG2DataCtrl.DeleteTsPIDs(Fcount,@Filters[FilterID-1].Pid);
   Filters[FilterID-1].Pid:=0;
   Result := True;
   Exit;
end;
  end;
 Result := false;
end;
exports DelFilter name 'DelFilter';

function GetTunerStatus(Level, Quality: PByte): Bool; stdcall;
var
hr: HRESULT;
lSignalStrength: DWord;
lSignalQuality: DWord;
fBER: float;
Begin
 lSignalStrength:=0;
 lSignalQuality:=0;
 level^:=0;
 quality^:=0;

 if B2C2MPEG2Filter=nil  then begin result:= false; exit;  end;
 if Signal_Quality_Sup  then
 begin
hr:= B2C2MPEG2TunerCtrl.GetSignalQuality(lSignalQuality);
if FAILED(hr) then  begin result:=  false; exit; end;
 end;
 if Signal_Strengths_Sup then
 begin
hr:= B2C2MPEG2TunerCtrl.GetSignalStrength(lSignalStrength);
if FAILED(hr)  then begin result:= false; exit; end;
quality^:=BYTE(lSignalStrength);
 end
 else
 if Signal_BER_Sup then
 begin
fBER:=0.0; 
hr:= B2C2MPEG2TunerCtrl.GetPreErrorCorrectionBER(fBER,true);
if FAILED(hr) then begin result:=  false;  exit; end;
 if fBER<10e-7  then quality^:=75
  else
 if fBER<10e-6 then quality^:=50
  else
   if fBER<10e-5
then
{*}quality^:=25 
else
(* 25%*)
{*}quality^:=0; 
 end
 (* (Signal.BER >= 10e-2)*)
 (* 0% *)
 else
 {*}quality^:=BYTE(lSignalQuality); 
 if not FAILED(B2C2MPEG2TunerCtrl.CheckLock())
 then
 begin 
{*}level^:=BYTE(lSignalQuality); 
if not (Signal_Strengths_Sup and Signal_BER_Sup)
then
{*}quality^:=quality^+25;
begin
  result:= true;
  exit;
end;
 end
 else
 {*}quality^:=0; 
 begin
result:=false; 
exit;
 end;
end;
exports GetTunerStatus name 'GetTunerStatus';

end.

Edited by Griga
code tags added
Link to comment
  • 6 months later...
unit SkyStar2;

interface
uses
Windows, SysUtils, Classes, Messages,B2C2SDK,directshow9,DSUtil,ActiveX,ComObj;
end.

 

 

Where or what is B2C2SDK? I am familiar with dspack very much but where would one get to

learn more about B2C2SDK?

 

Thanks for any help. English not so good, sorry.

Link to comment
  • 2 weeks later...
(* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*  Copyright © 2004-2006 Ekrem "ECoder" KOÇAK						*
*  Mail: ekremkocak@hotmail.com												 *
*																		   *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *)

unit B2C2SDK;

interface

uses
 Windows, directshow9;
const
 CLSID_B2C2MPEG2Filter: TGuid = '{E82536A0-94DA-11d2-A463-00A0C95D308D}';
 IID_IB2C2MPEG2TunerCtrl: TGuid = '{D875D4A9-0749-4fe8-ADB9-CC13F9B3DD45}';
 IID_IB2C2MPEG2AVCtrl: TGuid = '{295950B0-696D-4a04-9EE3-C031A0BFBEDE}';

 IID_IB2C2MPEG2TunerCtrl2: TGuid = '{CD900832-50DF-4f8f-882D-1C358F90B3F2}';
 IID_IB2C2MPEG2DataCtrl: TGuid = '{7F35C560-08B9-11d5-A469-00D0D7B2C2D7}';
 IID_IB2C2MPEG2DataCtrl2: TGuid = '{B0666B7C-8C7D-4c20-BB9B-4A7FE0F313A8}';
 IID_IB2C2MPEG2DataCtrl3: TGuid = '{E2857B5B-84E7-48b7-B842-4EF5E175F315}';
 IID_IB2C2MPEG2DataCtrl4:TGUID='{5927DB1C-B2AC-441f-89A7-C61194D15392}';
 IID_IB2C2MPEG2DataCtrl5:TGUID='{B5AFA7F3-2FBC-4d66-AD9C-FF8616141C26}';

 IID_IB2C2MPEG2AVCtrl2: TGuid = '{9C0563CE-2EF7-4568-A297-88C7BB824075}';
 IID_IB2C2MPEG2DataPin: TGuid = '{76604DC1-9052-4483-B57B-E3B353E45720}';
 IID_IB2C2MPEG2PvrCtrl: TGuid = '{A306AF1C-51D9-496d-9E7A-1CFE28F51FAD}';
 B2C2_DEVICE_ID = 'dvb:device:b2c2:';
type
 Float = Single;
 MPEG2_VIDEO_INFO = record
wHSize, // video data horizontal size in pixels
wVSize: Word; // video data vertical size in pixels
bAspectRatio, bFrameRate: Byte;
 end;

 TVideoCallback = function(out Info: MPEG2_VIDEO_INFO): HResult; stdcall;

 tMacAddressList = record
lCount: DWord;
MacAddr: array[0..31, 0..5] of byte;
 end;

 TTunerCapabilities = record
tTunerModulation: DWord; //??
dwConstellationSupported,
  dwFECSupported,
  dwMinTransponderFreqInKHz,
  dwMaxTransponderFreqInKHz,
  dwMinTunerFreqInKHz,
  dwMaxTunerFreqInKHz,
  dwMinSymbolRateInBaud,
  dwMaxSymbolRateInBaud,
  bAutoSymbolRate,
  dwPerformanceMonitoring: DWord;
 end;

 IB2C2MPEG2TunerCtrl = interface(IUnknown)
['{D875D4A9-0749-4fe8-ADB9-CC13F9B3DD45}']
function SetFrequency(dwSetFrequency: DWord): HResult; stdcall;
function SetSymbolRate(dwSetSymbolRate: DWord): HResult; stdcall;
function SetLnbFrequency(dwSetLnbFrequency: DWord): HResult; stdcall;
function SetFec(dwSetFec: DWord): HResult; stdcall;
function SetPolarity(dwSetPolarity: DWord): HResult; stdcall;
function SetLnbKHz(dwSetLnbKHz: DWord): HResult; stdcall;
function SetDiseqc(dwSetDiseqc: DWord): HResult; stdcall;
function SetModulation(dwSetModulation: DWord): HResult; stdcall;
function Initialize: Hresult; stdcall;
function SetTunerStatus: HResult; stdcall;
function CheckLock: HResult; stdcall;
function GetTunerCapabilities(out dwTuner: tTunerCapabilities; out plSize:
  DWord): HResult; stdcall;

// Terrestrial (ATSC)

function GetFrequency(out plFrequencyMHz: DWord): HResult; stdcall;
function GetSymbolRate(out plGetSymbolRate: DWord): HResult; stdcall;
function GetModulation(out plGetModulation: DWord): HResult; stdcall;
function GetSignalStrength(out plSignalStrength: DWord): HResult; stdcall;
function GetSignalLevel(out plSignalLevel: Float): HResult; stdcall;

function GetSNR(out plSNR: Float): HResult; stdcall;
function GetPreErrorCorrectionBER(out plError: Float; dwVal: boolean):
  HResult; stdcall;

function GetUncorrectedBlocks(out pluncorrected: Float): HResult; stdcall;
function GetTotalBlocks(out dwTotal: DWord): HResult; stdcall;
function GetChannel(out dwChannel: DWord): HResult; stdcall;
function SetChannel(dwChannel: DWord): HResult; stdcall;
 end;
 IB2C2MPEG2TunerCtrl2 = interface(IB2C2MPEG2TunerCtrl)
['{CD900832-50DF-4f8f-882D-1C358F90B3F2}']
function SetTunerStatusEx(dwTunerStatusEx: DWord): HResult; stdcall;
function SetFrequencyKHz(dwSetFrequency: DWord): HResult; stdcall;
// Terrestrial DVB only

function SetGuardInterval(dwSetGuardInterval: DWord): Hresult; stdcall;
function GetGuardInterval(out dwGetGuardInterval: DWord): HResult; stdcall;
function GetFec(out plFec: DWord): HResult; stdcall;
function GetPolarity(out plPolarity: DWord): Hresult; stdcall;
function GetDiseqc(out plDiseqc: DWord): HResult; stdcall;
function GetLnbKHz(out plLnbKHz: DWord): HResult; stdcall;
function GetLnbFrequency(out plFrequencyMHz: DWord): HResult; stdcall;
function GetCorrectedBlocks(out plCorrectedBlocks: DWord): HResult; stdcall;
function GetSignalQuality(out pdwSignalQuality: DWord): HResult; stdcall;
 end;

 IB2C2MPEG2DataCtrl = interface(IUnknown)
['{7F35C560-08B9-11d5-A469-00D0D7B2C2D7}']
function GetMaxPIDCount(out dwGetMaxPIDCount: DWord): HResult; stdcall;
function AddPIDs(dwAddPIDs: DWord; OutAddPid: Pointer): HResult; stdcall;
function DeletePIDs(dwDeletePIDs: DWord; OutDeletePIDs: Pointer): HResult;
  stdcall;
// IP methods

function GetMaxIpPIDCount(out dwMaxIP: Dword): HResult; stdcall;
function AddIpPIDs(size: DWord; plPIDArray: Pointer): HResult; stdcall;
  {PIDArray array?}
function DeleteIpPIDs(size: DWord; plPIDArray: pointer): HResult; stdcall;

function GetIpPIDs(out plCount: DWord; glPIDArray: Pointer): HResult;
  stdcall;

// All protocols

function PurgeGlobalPIDs: Hresult; stdcall;
function GetMaxGlobalPIDCount(out glMaxPIDCount: DWord): Hresult; stdcall;
function GetGlobalPIDs(out plCount: DWord; plPIDArray: Pointer): HResult;
  stdcall;
function ResetDataReceptionStats: Hresult; stdcall;
function GetDataReceptionStats(out plIPQuality, plTSQuality: DWord): HResult;
  stdcall;
 end;
 IB2C2MPEG2DataCtrl2 = interface(IB2C2MPEG2DataCtrl)
['{B0666B7C-8C7D-4c20-BB9B-4A7FE0F313A8}']
function AddPIDsToPin(out plNumPID: DWord; plPIDArray: PInteger;
  lDataPinIndex: DWord): HResult; stdcall;
function DeletePIDsFromPin(lNumPID: DWord; plPIDs: Pointer; lDataPinIndex:
  DWord): HResult; stdcall;
 end;

 IB2C2MPEG2DataCtrl3 = interface(IB2C2MPEG2DataCtrl2) // LINUX
['{E2857B5B-84E7-48b7-B842-4EF5E175F315}']
function AddTsPIDs(lCount: DWord;plPIDArray:PInteger): HResult; stdcall;
function DeleteTsPIDs(lCount: DWord;plPIDArray: PInteger): HResult;
  stdcall;
function GetTsState(out plOpen: DWord; out plRunning: DWord; out plCount:
  DWord; out plPIDArray: DWord): HResult; stdcall;
function GetIpState(out plOpen: DWord; out plRunning: DWord; out plCount:
  DWord; out plPIDArray: DWord): HResult; stdcall;
function GetReceivedDataIp(out pllDataRcv: int64; out pllIpRcv: int64):
  Hresult; stdcall;
function AddMulticastMacAddress(out pMacAddrList: tMacAddressList): Hresult;
  stdcall;
function GetMulticastMacAddressList(out pMacAddrList: tMacAddressList):
  Hresult; stdcall;
function DeleteMulticastMacAddress(out pMacAddrList: tMacAddressList):
  Hresult; stdcall;
function SetUnicastMacAddress(pMacAddr: PByte): HResult; stdcall;
function GetUnicastMacAddress(pMacAddr: PByte): HResult; stdcall;
function RestoreUnicastMacAddress: HResult; stdcall;
 end;

IB2C2MPEG2DataCtrl4 = interface(IB2C2MPEG2DataCtrl3)
['{5927DB1C-B2AC-441f-89A7-C61194D15392}']
function GetHardwareMacAddress(pHwMacAddr:PChar):HResult; stdcall;
function SetTableId(Value:Integer):HResult; stdcall;
function GetTableId(var Value:Integer):HResult; stdcall;
  // Key Methods
function GetKeyCount(var plTotal:Integer;var plPidTscKeys:Integer;var plPidKeys:Integer;var plGlobalKey:Integer):HResult; stdcall;
function GetKeysInUse(var plCount:Integer;var plTypeArray:PInteger;var plPidArray:PInteger):HResult; stdcall;
function AddKey(lType:Integer;lPid:Integer;pKey:PChar;lKeyLength:Integer):HResult; stdcall;
function DeleteKey(lType:Integer;lPid:Integer):HResult; stdcall;
function PurgeKeys:HResult; stdcall;
 end;

 IB2C2MPEG2DataCtrl5 = interface(IB2C2MPEG2DataCtrl4)
['{B5AFA7F3-2FBC-4d66-AD9C-FF8616141C26}']
function SetCallbackForTransportStream(pvCallBack:Pointer):HResult; stdcall;
 end;

 IB2C2MPEG2DataPin = interface(IUnknown)
['{76604DC1-9052-4483-B57B-E3B353E45720}']
//return the pin index
function GetDataPinIndex(out dwDataPinIndex: DWord): Hresult; stdcall;
//add PIDs to this pin
//Parameter:   a PID array, a pointer to long as number of PIDs in the array
//Return:	  FAILED() -- non added, plNumPID contains the number of PIDs added
function AddDataPIDs(out plNumPID: DWord; plPIDs: pinteger): Hresult;
  stdcall;
//delete PIDs to this pin
//Parameter:   a PID array, number of PIDs in the array
//Return:	  FAILED() -- non deleted
function DeleteDataPIDs(dwPIDCount: DWord; out dwPIDArray: DWord): Hresult;
  stdcall;
 end;

 IB2C2MPEG2AVCtrl = interface(IUnknown)
['{295950B0-696D-4a04-9EE3-C031A0BFBEDE}']
function SetAudioVideoPIDs(dwAPID, dwVPid: DWord): HResult; stdcall;
 end;

 IB2C2MPEG2AVCtrl2 = interface(IB2C2MPEG2AVCtrl)
['{9C0563CE-2EF7-4568-A297-88C7BB824075}']
function SetCallbackForVideoMode(Func: TVideoCallback): hresult; stdcall;
function DeleteAudioVideoPIDs(bAudioPID, bVideoPID: DWord): hresult;
  stdcall;
 function GetAudioVideoState(var plAudioOpen:Integer;var plVideoOpen:Integer;
  var plAudioRunning:Integer;var plVideoRunning:Integer;var plAudioPID:Integer;
  var plVideoPID:Integer):HResult; stdcall;
 end;

 IB2C2MPEG2PvrCtrl = interface(IUnknown)
function AddPids(lPids: Word; palPids: Pointer): Hresult; stdcall;
function DeletePids: Hresult; stdcall;
function SetCommand(eCommand: DWord; pvData: Pointer): Hresult; stdcall;
function GetStatistics(eStatistics: DWord; out pvData: int64): Hresult; stdcall;
function SetCallback(pvCallback: Pointer): Hresult; stdcall;
function SetPosition(ePosition: DWORD; iPositionData: int64): Hresult; stdcall;
 end;


const
 TUNER_CABLE = 0;
 TUNER_SATELLITE = 1;

 FEC_1_2 = 1;
 FEC_2_3 = 2;
 FEC_3_4 = 3;
 FEC_5_6 = 4;
 FEC_7_8 = 5;
 FEC_AUTO = 6;

 POL_HORI = 0;
 POL_VER = 1;
 POLARITY_LNB_NO_POWER = 10;
 LNB_NONE = 0;
 LNB_22Khz = 1;
 LNB_33Khz = 2;
 LNB_44Khz = 3;

  LNB_SELECTION_0 = 0;
LNB_SELECTION_22=1;
LNB_SELECTION_33=2;
LNB_SELECTION_44=3;

 DiseqC_None = 0;
 DiseqC_SimpleA = 1;
 DiseqC_SimpleB = 2;
 DiseqC_PosA_OptA = 3;
 DiseqC_PosB_OptA = 4;
 DiseqC_PosA_OptB = 5;
 DiseqC_PosB_OptB = 6;

 QAM_4 = 2;
 QAM_16 = 3;
 QAM_32 = 4;
 QAM_64 = 5;
 QAM_128 = 6;
 QAM_256 = 7;

 PVR_ENABLE = 0;
 PVR_RECORD_FILENAME = 1;
 PVR_AUTO_DELETE_RECORD_FILE = 2;
 PVR_AUTO_RECORD_WITH_PLAY = 3;
 PVR_FILE_START = 4;
 PVR_RECORD = 5;

 PVR_PLAY_FILE_EOF = 10;
 PVR_RECORD_FILE_ERROR = 11;

 PVR_START_POSITION = 0;
 PVR_END_POSITION = 1;
 PVR_RELATIVE_POSITION = 2;
 PVR_ABSOLUTE_POSITION = 3;

 PVR_RECORD_FILE_SIZE = 0;
 PVR_PLAY_FILE_POSITION = 1;


  BER_SUPPORTED:Integer=1;				// BER reporting via GetPreErrorCorrectionBER ()
 BLOCK_COUNT_SUPPORTED:Integer=1 shl 1;		// Block count report via GetTotalBlocks ()
 CORRECTED_BLOCK_COUNT_SUPPORTED:Integer=1 shl 2;		// Corrected block count via GetCorrectedBlocks
 UNCORRECTED_BLOCK_COUNT_SUPPORTED:Integer=(1 shl 3);		// Uncorrected block count via GetUncorrectedBlocks
 SNR_SUPPORTED:Integer=(1 shl 4);		// SNR via GetSNR ()
 SIGNAL_STRENGTH_SUPPORTED:Integer=(1 shl 5);		// Signal strength via GetSignalStrength()
 SIGNAL_QUALITY_SUPPORTED:Integer=(1 shl 6);


implementation


end.

Link to comment

This sdk has same problem my codes did. It will not work correctly for SDT on north america satellites. I will try to see why this is but it must be some trick to make it work. TSReader uses pid 0x46 to gather sdt but specs says 0x42 should be used. Either way, neither one will work for me, not in this sdk either. I must do more testing soon. This sdk you posted here is much much easier to work with than what i had so we shall see.

Link to comment

Ekrem i think if you can make the timeout for pmt and sdt longer the scan may work.

I tried in your source but i am not a delphi coder expert, i use c++, and those nested

functions in delphi make me headache very much.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...