線上訂房服務-台灣趴趴狗聯合訂房中心
發文 回覆 瀏覽次數:2477
推到 Plurk!
推到 Facebook!

[轉貼] Win32 Drivers for Digital/Video Camcorders

 
axsoft
版主


發表:681
回覆:1056
積分:969
註冊:2002-03-13

發送簡訊給我
#1 引用回覆 回覆 發表時間:2002-07-09 13:39:11 IP:61.218.xxx.xxx 未訂閱
WIN32 DRIVERS FOR DIGITAL/VIDEO CAMCORDERS by Thomas Tewell    The only thing wrong with the emerging class of digital/video camcorders is the lack of software to use them. Consequently, Thomas wrote a complete IEEE 1394 class driver package for Windows 98 and his new Sony DCR-PC10 digital/video camcorder. Additional resources include win32dv.txt (listings) and win32dv.zip (source code).    資料來源:http://www.ddj.com/ 下載:http://www.ddj.com/ftp/1999/1999_06/win32dv.zip    Table 1:     REQUEST_ASYNC_READ   REQUEST_ASYNC_WRITE REQUEST_ASYNC_LOCK   REQUEST_ISOCH_ALLOCATE_BANDWIDTH REQUEST_ISOCH_ALLOCATE_CHANNEL   REQUEST_ISOCH_ALLOCATE_RESOURCES REQUEST_ISOCH_ATTACH_BUFFERS   REQUEST_ISOCH_DETACH_BUFFERS REQUEST_ISOCH_FREE_BANDWIDTH   REQUEST_ISOCH_FREE_CHANNEL REQUEST_ISOCH_FREE_RESOURCES   REQUEST_ISOCH_LISTEN REQUEST_ISOCH_STOP   REQUEST_ISOCH_TALK REQUEST_ISOCH_QUERY_CYCLE_TIME   REQUEST_ISOCH_QUERY_RESOURCES REQUEST_ISOCH_SET_CHANNEL_BANDWIDTH   REQUEST_ALLOCATE_ADDRESS_RANGE REQUEST_FREE_ADDRESS_RANGE   REQUEST_GET_LOCAL_HOST_INFO REQUEST_GET_ADDR_FROM_DEVICE_OBJECT   REQUEST_CONTROL REQUEST_GET_SPEED_BETWEEN_DEVICES   REQUEST_SET_DEVICE_XMIT_PROPERTIES REQUEST_GET_CONFIGURATION_INFO   REQUEST_BUS_RESET REQUEST_GET_GENERATION_COUNT   REQUEST_SEND_PHY_CONFIG_PACKET REQUEST_GET_SPEED_TOPOLOGY_MAPS   REQUEST_BUS_RESET_NOTIFICATION  REQUEST_ASYNC_STREAM   REQUEST_SET_LOCAL_HOST_PROPERTIES    Example 1:     Irb = ExAllocatePool(NonPagedPool, sizeof(IRB));  ...Fill out IRB for desired 1394 function... NextIrpStack = IoGetNextIrpStackLocation(Irp); NextIrpStack->MajorFunction = IRP_MJ_INTERNAL_DEVICE_CONTROL; NextIrpStack->Parameters.DeviceIoControl.IoControlCode = IOCTL_1394_CLASS; NextIrpStack->Parameters.Others.Argument1 = Irb;  ...Setup IRP Completion Routine... status = IoCallDriver(DeviceExtension->SonyPC10DeviceObject,Irp);    Example 2:     USHORT Node_Vendor_Id UCHAR Chip_Id_High ULONG Chip_Id_Low.    Listing One /*----------------------------------------------------------------------- */ /* Filename: DDJDVTST.C                                                   */ /* Description: Dr. Dobb's Journal DV Frame Capture Driver Project        */ /*              Win32 Console Application for testing the DV Driver       */ /*----------------------------------------------------------------------- */ /* (C) Copyright 1994-1998 by Sequoia Advanced Technologies, Inc.         */ /* http://www.seqadvtech.com                                              */ /* All Rights Reserved.                                                   */ /*----------------------------------------------------------------------- */ #define STRICT #include  #include #define WIN32_LEAN_AND_MEAN #include #include #include "ddjdvw32.h" bswap(ULONG value) { __asm mov eax, value __asm bswap eax } main(int argc, char *argv[]) { HANDLE hDev; DWORD dwOutCount; DWORD inBuffer[2]; DWORD dwRet; printf("Dr. Dobb's DV Camcorder Driver Test Utility\n\n"); //----------------------------------------------------------------- // Open our DV Camcorder driver, if it is loaded. // This will result in DDJDV_Create being called in the driver. //----------------------------------------------------------------- hDev = CreateFile("\\\\.\\DDJDVCAP", GENERIC_WRITE | GENERIC_READ, FILE_SHARE_WRITE | FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL); if(hDev == INVALID_HANDLE_VALUE) { printf("DDJDVCAP Driver Not Loaded!!\n\n"); exit(1); } //------------------------------------------------------------------ // Send command to DV Driver to read Node Unique ID from Camcorder. // This will result in DDJDV_Dispatch being called in driver. //------------------------------------------------------------------- dwRet = DeviceIoControl(hDev, GET_NODE_UNIQUE_ID_CODE, NULL, 0, inBuffer, 8, &dwOutCount, NULL); //------------------------------------------------------------------- // Put in little-endian numeric format //-------------------------------------------------------------------- inBuffer[0] = bswap(inBuffer[0]); inBuffer[1] = bswap(inBuffer[1]); printf("Camcorder Vendor ID = %x\n",(inBuffer[0] >> 8)); printf("Camcorder Model ID = %x%.8x\n",(inBuffer[0] & 0xFF),inBuffer[1]); //------------------------------------------------------------------- // Close DV Driver. Will result in DDJDV_Close being called in driver. //-------------------------------------------------------------------- CloseHandle(hDev); return(0); } 1 時間就是金錢
系統時間:2024-11-23 15:55:47
聯絡我們 | Delphi K.Top討論版
本站聲明
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。
2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。
3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇!