⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ptp.h

📁 Media transfer protocol implementation on POSIX. Have detailed readme on how to move to windows
💻 H
📖 第 1 页 / 共 4 页
字号:
/* libptp2 extended ERROR codes */#define PTP_ERROR_IO			0x02FF#define PTP_ERROR_DATA_EXPECTED		0x02FE#define PTP_ERROR_RESP_EXPECTED		0x02FD#define PTP_ERROR_BADPARAM		0x02FC/* PTP Event Codes */#define PTP_EC_Undefined		0x4000#define PTP_EC_CancelTransaction	0x4001#define PTP_EC_ObjectAdded		0x4002#define PTP_EC_ObjectRemoved		0x4003#define PTP_EC_StoreAdded		0x4004#define PTP_EC_StoreRemoved		0x4005#define PTP_EC_DevicePropChanged	0x4006#define PTP_EC_ObjectInfoChanged	0x4007#define PTP_EC_DeviceInfoChanged	0x4008#define PTP_EC_RequestObjectTransfer	0x4009#define PTP_EC_StoreFull		0x400A#define PTP_EC_DeviceReset		0x400B#define PTP_EC_StorageInfoChanged	0x400C#define PTP_EC_CaptureComplete		0x400D#define PTP_EC_UnreportedStatus		0x400E/* Canon extension Event Codes */#define PTP_EC_CANON_ExtendedErrorcode		0xC005	/* ? */#define PTP_EC_CANON_ObjectInfoChanged		0xC008#define PTP_EC_CANON_RequestObjectTransfer	0xC009#define PTP_EC_CANON_CameraModeChanged		0xC00C#define PTP_EC_CANON_StartDirectTransfer	0xC011#define PTP_EC_CANON_StopDirectTransfer		0xC013/* Nikon extension Event Codes */#define PTP_EC_Nikon_ObjectAddedInSDRAM		0xC101/* Gets 1 parameter, objectid pointing to DPOF object */#define PTP_EC_Nikon_AdvancedTransfer		0xC103/* constants for GetObjectHandles */#define PTP_GOH_ALL_STORAGE 0xffffffff#define PTP_GOH_ALL_FORMATS 0x00000000#define PTP_GOH_ALL_ASSOCS  0x00000000/* PTP device info structure (returned by GetDevInfo) */struct _PTPDeviceInfo {	uint16_t StandardVersion;	uint32_t VendorExtensionID;	uint16_t VendorExtensionVersion;	char	*VendorExtensionDesc;	uint16_t FunctionalMode;	uint32_t OperationsSupported_len;	uint16_t *OperationsSupported;	uint32_t EventsSupported_len;	uint16_t *EventsSupported;	uint32_t DevicePropertiesSupported_len;	uint16_t *DevicePropertiesSupported;	uint32_t CaptureFormats_len;	uint16_t *CaptureFormats;	uint32_t ImageFormats_len;	uint16_t *ImageFormats;	char	*Manufacturer;	char	*Model;	char	*DeviceVersion;	char	*SerialNumber;};typedef struct _PTPDeviceInfo PTPDeviceInfo;/* PTP storageIDs structute (returned by GetStorageIDs) */struct _PTPStorageIDs {	uint32_t n;	uint32_t *Storage;};typedef struct _PTPStorageIDs PTPStorageIDs;/* PTP StorageInfo structure (returned by GetStorageInfo) */struct _PTPStorageInfo {	uint16_t StorageType;	uint16_t FilesystemType;	uint16_t AccessCapability;	uint64_t MaxCapability;	uint64_t FreeSpaceInBytes;	uint32_t FreeSpaceInImages;	char 	*StorageDescription;	char	*VolumeLabel;};typedef struct _PTPStorageInfo PTPStorageInfo;/* PTP objecthandles structure (returned by GetObjectHandles) */struct _PTPObjectHandles {	uint32_t n;	uint32_t *Handler;};typedef struct _PTPObjectHandles PTPObjectHandles;#define PTP_HANDLER_SPECIAL	0xffffffff#define PTP_HANDLER_ROOT	0x00000000/* PTP objectinfo structure (returned by GetObjectInfo) */struct _PTPObjectInfo {	uint32_t StorageID;	uint16_t ObjectFormat;	uint16_t ProtectionStatus;	uint32_t ObjectCompressedSize;	uint16_t ThumbFormat;	uint32_t ThumbCompressedSize;	uint32_t ThumbPixWidth;	uint32_t ThumbPixHeight;	uint32_t ImagePixWidth;	uint32_t ImagePixHeight;	uint32_t ImageBitDepth;	uint32_t ParentObject;	uint16_t AssociationType;	uint32_t AssociationDesc;	uint32_t SequenceNumber;	char 	*Filename;	time_t	CaptureDate;	time_t	ModificationDate;	char	*Keywords;};typedef struct _PTPObjectInfo PTPObjectInfo;/* max ptp string length INCLUDING terminating null character */#define PTP_MAXSTRLEN				255/* PTP Object Format Codes *//* ancillary formats */#define PTP_OFC_Undefined			0x3000#define PTP_OFC_Association			0x3001#define PTP_OFC_Script				0x3002#define PTP_OFC_Executable			0x3003#define PTP_OFC_Text				0x3004#define PTP_OFC_HTML				0x3005#define PTP_OFC_DPOF				0x3006#define PTP_OFC_AIFF	 			0x3007#define PTP_OFC_WAV				0x3008#define PTP_OFC_MP3				0x3009#define PTP_OFC_AVI				0x300A#define PTP_OFC_MPEG				0x300B#define PTP_OFC_ASF				0x300C#define PTP_OFC_QT				0x300D /* guessing *//* image formats */#define PTP_OFC_EXIF_JPEG			0x3801#define PTP_OFC_TIFF_EP				0x3802#define PTP_OFC_FlashPix			0x3803#define PTP_OFC_BMP				0x3804#define PTP_OFC_CIFF				0x3805#define PTP_OFC_Undefined_0x3806		0x3806#define PTP_OFC_GIF				0x3807#define PTP_OFC_JFIF				0x3808#define PTP_OFC_PCD				0x3809#define PTP_OFC_PICT				0x380A#define PTP_OFC_PNG				0x380B#define PTP_OFC_Undefined_0x380C		0x380C#define PTP_OFC_TIFF				0x380D#define PTP_OFC_TIFF_IT				0x380E#define PTP_OFC_JP2				0x380F#define PTP_OFC_JPX				0x3810/* Eastman Kodak extension ancillary format */#define PTP_OFC_EK_M3U				0xb002/* MTP extensions */#define PTP_OFC_MTP_Firmware			0xb802#define PTP_OFC_MTP_WindowsImageFormat		0xb882#define PTP_OFC_MTP_UndefinedAudio		0xb900#define PTP_OFC_MTP_WMA				0xb901#define PTP_OFC_MTP_OGG				0xb902#define PTP_OFC_MTP_AudibleCodec		0xb904#define PTP_OFC_MTP_UndefinedVideo		0xb980#define PTP_OFC_MTP_WMV				0xb981#define PTP_OFC_MTP_MP4				0xb982#define PTP_OFC_MTP_UndefinedCollection		0xba00#define PTP_OFC_MTP_AbstractMultimediaAlbum	0xba01#define PTP_OFC_MTP_AbstractImageAlbum		0xba02#define PTP_OFC_MTP_AbstractAudioAlbum		0xba03#define PTP_OFC_MTP_AbstractVideoAlbum		0xba04#define PTP_OFC_MTP_AbstractAudioVideoPlaylist	0xba05#define PTP_OFC_MTP_AbstractContactGroup	0xba06#define PTP_OFC_MTP_AbstractMessageFolder	0xba07#define PTP_OFC_MTP_AbstractChapteredProduction	0xba08#define PTP_OFC_MTP_WPLPlaylist			0xba10#define PTP_OFC_MTP_M3UPlaylist			0xba11#define PTP_OFC_MTP_MPLPlaylist			0xba12#define PTP_OFC_MTP_ASXPlaylist			0xba13#define PTP_OFC_MTP_PLSPlaylist			0xba14#define PTP_OFC_MTP_UndefinedDocument		0xba80#define PTP_OFC_MTP_AbstractDocument		0xba81#define PTP_OFC_MTP_UndefinedMessage		0xbb00#define PTP_OFC_MTP_AbstractMessage		0xbb01#define PTP_OFC_MTP_UndefinedContact		0xbb80#define PTP_OFC_MTP_AbstractContact		0xbb81#define PTP_OFC_MTP_vCard2			0xbb82#define PTP_OFC_MTP_vCard3			0xbb83#define PTP_OFC_MTP_UndefinedCalendarItem	0xbe00#define PTP_OFC_MTP_AbstractCalendarItem	0xbe01#define PTP_OFC_MTP_vCalendar1			0xbe02#define PTP_OFC_MTP_vCalendar2			0xbe03#define PTP_OFC_MTP_UndefinedWindowsExecutable	0xbe80/* PTP Association Types */#define PTP_AT_Undefined			0x0000#define PTP_AT_GenericFolder			0x0001#define PTP_AT_Album				0x0002#define PTP_AT_TimeSequence			0x0003#define PTP_AT_HorizontalPanoramic		0x0004#define PTP_AT_VerticalPanoramic		0x0005#define PTP_AT_2DPanoramic			0x0006#define PTP_AT_AncillaryData			0x0007/* PTP Protection Status */#define PTP_PS_NoProtection			0x0000#define PTP_PS_ReadOnly				0x0001/* PTP Storage Types */#define PTP_ST_Undefined			0x0000#define PTP_ST_FixedROM				0x0001#define PTP_ST_RemovableROM			0x0002#define PTP_ST_FixedRAM				0x0003#define PTP_ST_RemovableRAM			0x0004/* PTP FilesystemType Values */#define PTP_FST_Undefined			0x0000#define PTP_FST_GenericFlat			0x0001#define PTP_FST_GenericHierarchical		0x0002#define PTP_FST_DCF				0x0003/* PTP StorageInfo AccessCapability Values */#define PTP_AC_ReadWrite			0x0000#define PTP_AC_ReadOnly				0x0001#define PTP_AC_ReadOnly_with_Object_Deletion	0x0002/* Property Describing Dataset, Range Form */union _PTPPropertyValue {	char		*str;	/* common string, malloced */	uint8_t		u8;	int8_t		i8;	uint16_t	u16;	int16_t		i16;	uint32_t	u32;	int32_t		i32;	/* XXXX: 64bit and 128 bit signed and unsigned missing */	struct array {		uint32_t	count;		union _PTPPropertyValue	*v;	/* malloced, count elements */	} a;};typedef union _PTPPropertyValue PTPPropertyValue;/* Metadata lists for MTP operations */struct _MTPPropList {	uint16_t 	 	property;	uint16_t 	 	datatype;	uint32_t 	 	ObjectHandle;	PTPPropertyValue 	propval;	struct _MTPPropList 	*next;};typedef struct _MTPPropList MTPPropList;struct _PTPPropDescRangeForm {	PTPPropertyValue 	MinimumValue;	PTPPropertyValue 	MaximumValue;	PTPPropertyValue 	StepSize;};typedef struct _PTPPropDescRangeForm PTPPropDescRangeForm;/* Property Describing Dataset, Enum Form */struct _PTPPropDescEnumForm {	uint16_t		NumberOfValues;	PTPPropertyValue	*SupportedValue;	/* malloced */};typedef struct _PTPPropDescEnumForm PTPPropDescEnumForm;/* Device Property Describing Dataset (DevicePropDesc) */struct _PTPDevicePropDesc {	uint16_t		DevicePropertyCode;	uint16_t		DataType;	uint8_t			GetSet;	PTPPropertyValue	FactoryDefaultValue;	PTPPropertyValue	CurrentValue;	uint8_t			FormFlag;	union	{		PTPPropDescEnumForm	Enum;		PTPPropDescRangeForm	Range;	} FORM;};typedef struct _PTPDevicePropDesc PTPDevicePropDesc;/* Object Property Describing Dataset (DevicePropDesc) */struct _PTPObjectPropDesc {	uint16_t		ObjectPropertyCode;	uint16_t		DataType;	uint8_t			GetSet;	PTPPropertyValue	FactoryDefaultValue;	uint32_t		GroupCode;	uint8_t			FormFlag;	union	{		PTPPropDescEnumForm	Enum;		PTPPropDescRangeForm	Range;	} FORM;};typedef struct _PTPObjectPropDesc PTPObjectPropDesc;/* Canon filesystem's folder entry Dataset */#define PTP_CANON_FilenameBufferLen	13#define PTP_CANON_FolderEntryLen	28struct _PTPCANONFolderEntry {	uint32_t	ObjectHandle;	uint16_t	ObjectFormatCode;	uint8_t		Flags;	uint32_t	ObjectSize;	time_t		Time;	char		Filename[PTP_CANON_FilenameBufferLen];};typedef struct _PTPCANONFolderEntry PTPCANONFolderEntry;/* Nikon Tone Curve Data */#define PTP_NIKON_MaxCurvePoints 19struct _PTPNIKONCoordinatePair {	uint8_t		X;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -