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

📄 libreal.h

📁 realmedia解压源码
💻 H
字号:
/***************************************************************************** * libreal  -  A library for writing and extracting data streams to and from * *             RealMedia files.                                              * * Copyright (C) 2001 Leo Howell                                             * *                                                                           * * This program is free software; you can redistribute it and/or modify      * * it under the terms of the GNU General Public License as published by      * * the Free Software Foundation; either version 2 of the License, or         * * (at your option) and later version.                                       * *                                                                           * * This program is distributed in the hope that it will be useful,           * * but WITHOUT ANY WARRANTY; without even the implied warranty of            * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the             * * GNU General Public License for more details.                              * *                                                                           * * You should have received a copy of the GNU General Public License         * * along with this program; if not, write to the Free Software               * * Foundation, Inc., 59 Temple Place, Suite 330, Boston MA  02111-1307  USA  * *                                                                           * * You can contact me by email, leo_howell@users.sourceforge.net             * *****************************************************************************/#ifndef _LIBRM_H#define _LIBRM_H#include <stdint.h> /* for uint32_t etc */#define MAKE_FOURCC(a, b, c, d) \         (((uint32_t)(a)) << 24 \        | ((uint32_t)(b)) << 16 \        | ((uint32_t)(c)) << 8  \        | ((uint32_t)(d)))#define FILE_HEADER_ID      MAKE_FOURCC('.','R','M','F')#define PROPERTIES_ID       MAKE_FOURCC('P','R','O','P')#define MEDIA_PROPERTIES_ID MAKE_FOURCC('M','D','P','R')#define CONTENT_HEADER_ID   MAKE_FOURCC('C','O','N','T')#define DATA_HEADER_ID      MAKE_FOURCC('D','A','T','A')#define INDEX_HEADER_ID     MAKE_FOURCC('I','N','D','X')#define PN_SAVE_ENABLED         0x0001#define PN_PERFECT_PLAY_ENABLED 0x0002#define PN_LIVE_BROADCAST       0x0004#define PN_RELIABLE_FLAG 0x0001#define PN_KEYFRAME_FLAG 0x0002typedef struct {	uint32_t object_id;	uint32_t size;	uint16_t object_version;} RM_Tagged_Chunk_Header;typedef struct {	uint32_t file_version;	uint32_t num_headers;} RM_File_Header;typedef struct {	uint32_t max_bit_rate;	uint32_t avg_bit_rate;	uint32_t max_packet_size;	uint32_t avg_packet_size;	uint32_t num_packets;	uint32_t duration;	uint32_t preroll;	uint32_t index_offset;	uint32_t data_offset;	uint16_t num_streams;	uint16_t flags;} RM_Properties;typedef struct {	uint16_t stream_number;	uint32_t max_bit_rate;	uint32_t avg_bit_rate;	uint32_t max_packet_size;	uint32_t avg_packet_size;	uint32_t start_time;	uint32_t preroll;	uint32_t duration;	uint8_t  stream_name_size;	uint8_t *stream_name;	uint8_t  mime_type_size;	uint8_t *mime_type;	uint32_t type_specific_len;	uint8_t *type_specific_data;} RM_Media_Properties;typedef struct {	uint16_t title_len;	uint8_t *title;	uint16_t author_len;	uint8_t *author;	uint16_t copyright_len;	uint8_t *copyright;	uint16_t comment_len;	uint8_t *comment;} RM_Content_Description;typedef struct {	uint32_t num_packets;	uint32_t next_data_header;} RM_Data_Chunk_Header;/* NOTE: *  This is the complete Media Packet Header, * ie, it does *not* include object_id or size. * * Also note, the "length" in this structure will be * adjusted on read to be the length of the data *ONLY*. */typedef struct {	uint16_t object_version;	uint16_t length;	uint16_t stream_number;	uint32_t timestamp;	uint8_t  reserved;	uint8_t  flags;	uint8_t *data;} RM_Media_Packet_Header;typedef struct {	uint32_t num_indices;	uint16_t stream_number;	uint32_t next_index_header;} RM_Index_Chunk_Header;/* NOTE: *  Again, this is a complete sub-chunk. */typedef struct {	uint16_t object_version;	uint32_t timestamp;	uint32_t offset;	uint32_t packet_count_for_this_packet;} RM_Index_Record;typedef struct {	RM_Tagged_Chunk_Header header;	union {		RM_File_Header file_header;		RM_Properties properties;		RM_Media_Properties media_properties;		RM_Content_Description content_description;		RM_Data_Chunk_Header data_chunk_header;		RM_Index_Chunk_Header index_chunk_header;	} data;} RM_Chunk;/* Function declarations */int rm_read_chunk(int fd, RM_Chunk *);int rm_read_tagged_chunk_header(int fd, RM_Tagged_Chunk_Header *);int rm_read_file_header(int fd, RM_File_Header *);int rm_read_properties(int fd, RM_Properties *);int rm_read_media_properties(int fd, RM_Media_Properties *);int rm_read_content_description(int fd, RM_Content_Description *);int rm_read_data_chunk_header(int fd, RM_Data_Chunk_Header *);int rm_read_media_packet_header(int fd, RM_Media_Packet_Header *);int rm_read_index_chunk_header(int fd, RM_Index_Chunk_Header *);int rm_read_index_record(int fd, RM_Index_Record *);int rm_write_chunk(int fd, const RM_Chunk *);int rm_write_tagged_chunk_header(int fd, const RM_Tagged_Chunk_Header *);int rm_write_file_header(int fd, const RM_File_Header *);int rm_write_properties(int fd, const RM_Properties *);int rm_write_media_properties(int fd, const RM_Media_Properties *);int rm_write_content_description(int fd, const RM_Content_Description *);int rm_write_data_chunk_header(int fd, const RM_Data_Chunk_Header *);int rm_write_media_packet_header(int fd, const RM_Media_Packet_Header *);int rm_write_index_chunk_header(int fd, const RM_Index_Chunk_Header *);int rm_write_index_record(int fd, const RM_Index_Record *);#endif

⌨️ 快捷键说明

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