streamreader.dll описание библеотеки

Граббинг, Шаринг, Настройка ресиверов...
nedcomm
Начинающий
Начинающий
Сообщения: 2
Зарегистрирован: 11.09.2010 15:15
Sat-ресивер: s1401
Откуда: туркмения

streamreader.dll описание библеотеки

Непрочитанное сообщение#1 » nedcomm » 21.09.2010 21:09

Изображение
Помогите не знаю где найти описание к функциям streamreader.dll - для программирования - извините если не по адресу. очень нужно :D

Аватара пользователя
Blaze
Информатик-аналитик
Информатик-аналитик
Сообщения: 8933
Зарегистрирован: 24.05.2007 17:23
Модель телефона: POCO X3 Pro 6/128
Прошивка: crDroid v7.7
Sat-ресивер: Tiviar Mini HD
Откуда: Данков
Контактная информация:

Re: streamreader.dll-описание библеотеки

Непрочитанное сообщение#2 » Blaze » 22.09.2010 13:10

Вот, что удалось найти:

Axess DM1105 Streamreader source http://sourceforge.net/projects/axessdm1105sr/
http://www.gs.ru/soft/si/ss1/dsr/dsr33_source.zip
http://downloads.sourceforge.net/vstb/V ... 040711.zip
http://www.sources.ru/pascal/network/vysniff.zip
http://www.gs.ru/soft/si/ss1/tv/winstb/ ... Source.zip

streamreader.pas

Код: Выделить всё

unit StreamReader;
{UnitStreamReaderImport copyright by CBArts(CBArts@tripod.de)}
interface

uses Windows;

const DISEQC_HIGH_NIBLE=$F0;
      DISEQC_LOW_BAND  =$00;
      DISEQC_HIGH_BAND =$01;
      DISEQC_VERTICAL  =$00;
      DISEQC_HORIZONTAL=$02;
      DISEQC_POSITION_A=$00;
      DISEQC_POSITION_B=$04;
      DISEQC_OPTION_A  =$00;
      DISEQC_OPTION_B  =$08;

type BytePointer=^Byte;

{$EXTERNALSYM CheckForDVB}
function CheckForDVB:boolean;cdecl;
{$EXTERNALSYM StartDVB}
function StartDVB:boolean;cdecl;
{$EXTERNALSYM StopDVB}
function StopDVB:boolean;cdecl;
{$EXTERNALSYM SendDiSEqC}
function SendDiSEqC(DiSEqCType:DWord;data:Byte):boolean;cdecl;
{$EXTERNALSYM SetChannel}
function SetChannel(freq,symb,pol,fec,lof1,lof2,lofsw:DWord):boolean;cdecl;
{$EXTERNALSYM SetFilter}
function SetFilter(pid:Word;DVBCALLBACK:Pointer;CallBackType,
  Size:DWord;lpdwReserved:Pointer):boolean;cdecl;
{$EXTERNALSYM SetBitFilter}
function SetBitFilter(pid:Word;FilterData,FilterMask:BytePointer;
  FilterLength:Byte; DVBCALLBACK:Pointer;
  lpdwReserved:Pointer):boolean;cdecl;
{$EXTERNALSYM DelFilter}
function DelFilter(dwReserved:DWord):boolean;cdecl;

implementation

const srdll='StreamReader.dll';

function CheckForDVB; external srdll name 'CheckForDVB';
function StartDVB;    external srdll name 'StartDVB';
function StopDVB;     external srdll name 'StopDVB';
function SendDiSEqC;  external srdll name 'SendDiSEqC';
function SetChannel;  external srdll name 'SetChannel';
function SetFilter;   external srdll name 'SetFilter';
function SetBitFilter;external srdll name 'SetBitFilter';
function DelFilter;   external srdll name 'DelFilter';

end.
на C# - пишет поток в файл.

Код: Выделить всё

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Runtime.InteropServices;
using Microsoft.Win32.SafeHandles;
using System.Threading;
using System.Collections;
using System.IO;

namespace SkyLaboratory
{


public partial class Form1 : Form
{
FileStream f = null;

delegate void Log(string txt);
private void log(string txt)
{
if (logBox.InvokeRequired)
{
Log d = new Log(log);
logBox.Invoke(d, new object[] { txt });
}
else
{
logBox.Items.Add(txt);
}
Thread.Sleep(TimeSpan.FromTicks(1));
}

public delegate void CallbackStr(IntPtr pByteArray, UInt16 l);
public void str(IntPtr pByteArray, UInt16 l)
{
if (l == 0)
{
log("l len = 0");
return;
}


byte[] buff = new byte[l];


Marshal.Copy(pByteArray, buff, 0, l);

if (buff[0] != 0x47)
{
log("bad sync byte 0x47");
return;
}

if (buff[1] > 0x80)
{
log("bad sync byte 0x80");
return;
}

int i = 0;
f.Write(buff, i, l);

return;
}

[DllImport("streamreader.dll", SetLastError = true, CharSet = CharSet.Auto)]
public static extern bool CheckForDVB();
[DllImport("streamreader.dll", SetLastError = true, CharSet = CharSet.Auto)]
public static extern bool StartDVB();
[DllImport("streamreader.dll", SetLastError = true, CharSet = CharSet.Auto)]
public static extern bool StopDVB();
[DllImport("streamreader.dll", SetLastError = true, CharSet = CharSet.Auto)]
public static extern bool SetChannel(uint frec, uint smyb, uint pol, uint fec, uint lof1, uint lof2, uint lofsw);

[DllImport("streamreader.dll", SetLastError = true, CharSet = CharSet.None)]
public static extern bool SetFilter(uint pid, CallbackStr lpFunc, uint CallBackType, uint size, ref uint lpfilter_num);

[DllImport("streamreader.dll", SetLastError = true, CharSet = CharSet.Auto)]
public static extern bool DelFilter(uint filter_num);
[DllImport("streamreader.dll", SetLastError = true, CharSet = CharSet.Auto)]
public static extern bool GetSignal(ref int sig);

uint FilterHandle;

public Form1()
{
InitializeComponent();
}



private void Form1_Load(object sender, EventArgs e)
{
f = new FileStream("stream.dat", FileMode.Append);
}

private void button1_Click(object sender, EventArgs e)
{
CallbackStr callback = new CallbackStr(str);
log("start - ok");
if (!CheckForDVB()) { log("CheckForDVB - failed"); }
else
{
log("CheckForDVB - ok");
if (!StartDVB()) { log("StartDVB - failed"); }
else
{
log("StartDVB - ok");
uint lof1 = 9750000;
uint lof2 = 10600000;
uint lofsw = 11700000;
uint freq = 10845000;
uint sr = 27500000;
uint pol = 1;
uint fec = 0;
if (!SetChannel(freq, sr, pol, fec, lof1, lof2, lofsw)) { log("SetChannel - failed"); }
else
{
log("SetChannel - ok");



if (!SetFilter(8192, callback, 2, 0, ref FilterHandle))
{
log("SetFilter - failed");
}
else
{
log("SetFilter - ok");
}
}
}
}

}

private void Form1_FormClosed(object sender, FormClosedEventArgs e)
{
f.Close();
}
}

}

nedcomm
Начинающий
Начинающий
Сообщения: 2
Зарегистрирован: 11.09.2010 15:15
Sat-ресивер: s1401
Откуда: туркмения

Re: streamreader.dll описание библеотеки

Непрочитанное сообщение#3 » nedcomm » 22.09.2010 20:35

Огромное спасибо Blaze за помощь . сяду разбиратся с кодом :Yahoo!: :D :Yahoo!: :lol:

Ответить