📄 readme
字号:
librealThis is a straightforward implementation of the RealMedia spec.Just use make to compile it, and put the library in /usr/local/liband libreal.h in /usr/local/include or wherever.A realmedia file is split into several sections of chunks andsubchunks.All the IO functions in this library must be passed a file descriptor,which can be a file or a pipe.You can read a chunk by calling rm_read_chunk(int fd, RM_Chunk *chunk),where *chunk is a pointer to a variable of type RM_Chunk (defined inlibreal.h) and fd is the file descriptor. It's then your responsibilityto deal with it however you want, depending on the object id, which canbe one of: FILE_HEADER_ID PROPERTIES_ID MEDIA_PROPERTIES_ID CONTENT_HEADER_ID DATA_HEADER_ID INDEX_HEADER_IDData Headers and Index Headers are followed by sub-chunks of typeMedia Packet Header and Index Record respectively. To read theseuse rm_read_media_packet_header(int fd, RM_Media_Packet_Header *header)and rm_read_index_record(int fd, RM_Index_Record *rec).Writing is the same except the functions are rm_write_* instead ofrm_read_*.All functions return 0 on success and non-zero on failure. Sometimes theyprint error messages to stderr.By default libreal ignores the version field of chunks, this usuallydoesn't cause too many problems. If you want it to return an error fora non-zero version (I have only implemented version 0) then comment outthe appropriate line in the makefile.For information on the various fields and chunk types, take a look atlibreal.hI have included a test program which reads in a realmedia file called"test.rm" in the current directory, parses it and uses librm to writethe file out to "test-out.rm". NOTE: the strings in media propertiesand content description are NOT null-terminated. test.c assumes thatthey are. It may crash, or print garbage after the end of the string.Leo Howell
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -