| buffer.h | | buffer.h | |
| | | | |
| skipping to change at line 43 | | skipping to change at line 43 | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| extern "C" { | | extern "C" { | |
| #endif | | #endif | |
| | | | |
| #include <string.h> | | #include <string.h> | |
| #include <stdio.h> | | #include <stdio.h> | |
| #include <pthread.h> | | #include <pthread.h> | |
| #include <sys/types.h> | | #include <sys/types.h> | |
| | | | |
|
| #ifdef XINE_COMPILE | | #include <xine/os_types.h> | |
| # include <inttypes.h> | | #include <xine/attributes.h> | |
| # include "attributes.h" | | | |
| #else | | | |
| # include <xine/os_types.h> | | | |
| # include <xine/attributes.h> | | | |
| #endif | | | |
| | | | |
| #define BUF_MAX_CALLBACKS 5 | | #define BUF_MAX_CALLBACKS 5 | |
| | | | |
|
| /* | | /** | |
| * buffer types | | * @defgroup buffer_types Buffer Types | |
| * | | * | |
| * a buffer type ID describes the contents of a buffer | | * a buffer type ID describes the contents of a buffer | |
| * it consists of three fields: | | * it consists of three fields: | |
| * | | * | |
| * buf_type = 0xMMDDCCCC | | * buf_type = 0xMMDDCCCC | |
| * | | * | |
| * MM : major buffer type (CONTROL, VIDEO, AUDIO, SPU) | | * MM : major buffer type (CONTROL, VIDEO, AUDIO, SPU) | |
| * DD : decoder selection (e.g. MPEG, OPENDIVX ... for VIDEO) | | * DD : decoder selection (e.g. MPEG, OPENDIVX ... for VIDEO) | |
| * CCCC : channel number or other subtype information for the decoder | | * CCCC : channel number or other subtype information for the decoder | |
| */ | | */ | |
|
| | | /*@{*/ | |
| | | | |
| #define BUF_MAJOR_MASK 0xFF000000 | | #define BUF_MAJOR_MASK 0xFF000000 | |
| #define BUF_DECODER_MASK 0x00FF0000 | | #define BUF_DECODER_MASK 0x00FF0000 | |
| | | | |
|
| /* control buffer types */ | | /** | |
| | | * @defgroup buffer_ctrl Control buffer types | |
| | | */ | |
| | | /*@{*/ | |
| #define BUF_CONTROL_BASE 0x01000000 | | #define BUF_CONTROL_BASE 0x01000000 | |
| #define BUF_CONTROL_START 0x01000000 | | #define BUF_CONTROL_START 0x01000000 | |
| #define BUF_CONTROL_END 0x01010000 | | #define BUF_CONTROL_END 0x01010000 | |
| #define BUF_CONTROL_QUIT 0x01020000 | | #define BUF_CONTROL_QUIT 0x01020000 | |
|
| #define BUF_CONTROL_DISCONTINUITY 0x01030000 /* former AVSYNC_RESET */ | | #define BUF_CONTROL_DISCONTINUITY 0x01030000 /**< former AVSYNC_RESET */ | |
| #define BUF_CONTROL_NOP 0x01040000 | | #define BUF_CONTROL_NOP 0x01040000 | |
| #define BUF_CONTROL_AUDIO_CHANNEL 0x01050000 | | #define BUF_CONTROL_AUDIO_CHANNEL 0x01050000 | |
| #define BUF_CONTROL_SPU_CHANNEL 0x01060000 | | #define BUF_CONTROL_SPU_CHANNEL 0x01060000 | |
| #define BUF_CONTROL_NEWPTS 0x01070000 | | #define BUF_CONTROL_NEWPTS 0x01070000 | |
| #define BUF_CONTROL_RESET_DECODER 0x01080000 | | #define BUF_CONTROL_RESET_DECODER 0x01080000 | |
| #define BUF_CONTROL_HEADERS_DONE 0x01090000 | | #define BUF_CONTROL_HEADERS_DONE 0x01090000 | |
| #define BUF_CONTROL_FLUSH_DECODER 0x010a0000 | | #define BUF_CONTROL_FLUSH_DECODER 0x010a0000 | |
| #define BUF_CONTROL_RESET_TRACK_MAP 0x010b0000 | | #define BUF_CONTROL_RESET_TRACK_MAP 0x010b0000 | |
|
| | | /*@}*/ | |
| | | | |
|
| /* video buffer types: (please keep in sync with buffer_types.c) */ | | /** | |
| | | * @defgroup buffer_video Video buffer types | |
| | | * @note (please keep in sync with buffer_types.c) | |
| | | */ | |
| | | /*@{*/ | |
| #define BUF_VIDEO_BASE 0x02000000 | | #define BUF_VIDEO_BASE 0x02000000 | |
|
| #define BUF_VIDEO_UNKNOWN 0x02ff0000 /* no decoder should handle this
one */ | | #define BUF_VIDEO_UNKNOWN 0x02ff0000 /**< no decoder should handle thi
s one */ | |
| #define BUF_VIDEO_MPEG 0x02000000 | | #define BUF_VIDEO_MPEG 0x02000000 | |
| #define BUF_VIDEO_MPEG4 0x02010000 | | #define BUF_VIDEO_MPEG4 0x02010000 | |
| #define BUF_VIDEO_CINEPAK 0x02020000 | | #define BUF_VIDEO_CINEPAK 0x02020000 | |
| #define BUF_VIDEO_SORENSON_V1 0x02030000 | | #define BUF_VIDEO_SORENSON_V1 0x02030000 | |
| #define BUF_VIDEO_MSMPEG4_V2 0x02040000 | | #define BUF_VIDEO_MSMPEG4_V2 0x02040000 | |
| #define BUF_VIDEO_MSMPEG4_V3 0x02050000 | | #define BUF_VIDEO_MSMPEG4_V3 0x02050000 | |
| #define BUF_VIDEO_MJPEG 0x02060000 | | #define BUF_VIDEO_MJPEG 0x02060000 | |
| #define BUF_VIDEO_IV50 0x02070000 | | #define BUF_VIDEO_IV50 0x02070000 | |
| #define BUF_VIDEO_IV41 0x02080000 | | #define BUF_VIDEO_IV41 0x02080000 | |
| #define BUF_VIDEO_IV32 0x02090000 | | #define BUF_VIDEO_IV32 0x02090000 | |
| | | | |
| skipping to change at line 147 | | skipping to change at line 149 | |
| #define BUF_VIDEO_YV12 0x02310000 | | #define BUF_VIDEO_YV12 0x02310000 | |
| #define BUF_VIDEO_SEGA 0x02320000 | | #define BUF_VIDEO_SEGA 0x02320000 | |
| #define BUF_VIDEO_RV20 0x02330000 | | #define BUF_VIDEO_RV20 0x02330000 | |
| #define BUF_VIDEO_RV30 0x02340000 | | #define BUF_VIDEO_RV30 0x02340000 | |
| #define BUF_VIDEO_MVI2 0x02350000 | | #define BUF_VIDEO_MVI2 0x02350000 | |
| #define BUF_VIDEO_UCOD 0x02360000 | | #define BUF_VIDEO_UCOD 0x02360000 | |
| #define BUF_VIDEO_WMV9 0x02370000 | | #define BUF_VIDEO_WMV9 0x02370000 | |
| #define BUF_VIDEO_INTERPLAY 0x02380000 | | #define BUF_VIDEO_INTERPLAY 0x02380000 | |
| #define BUF_VIDEO_RV40 0x02390000 | | #define BUF_VIDEO_RV40 0x02390000 | |
| #define BUF_VIDEO_PSX_MDEC 0x023A0000 | | #define BUF_VIDEO_PSX_MDEC 0x023A0000 | |
|
| #define BUF_VIDEO_YUV_FRAMES 0x023B0000 /* uncompressed YUV, delivered by
v4l input plugin */ | | #define BUF_VIDEO_YUV_FRAMES 0x023B0000 /**< uncompressed YUV, delivered
by v4l input plugin */ | |
| #define BUF_VIDEO_HUFFYUV 0x023C0000 | | #define BUF_VIDEO_HUFFYUV 0x023C0000 | |
| #define BUF_VIDEO_IMAGE 0x023D0000 | | #define BUF_VIDEO_IMAGE 0x023D0000 | |
| #define BUF_VIDEO_THEORA 0x023E0000 | | #define BUF_VIDEO_THEORA 0x023E0000 | |
| #define BUF_VIDEO_4XM 0x023F0000 | | #define BUF_VIDEO_4XM 0x023F0000 | |
| #define BUF_VIDEO_I420 0x02400000 | | #define BUF_VIDEO_I420 0x02400000 | |
| #define BUF_VIDEO_VP4 0x02410000 | | #define BUF_VIDEO_VP4 0x02410000 | |
| #define BUF_VIDEO_VP5 0x02420000 | | #define BUF_VIDEO_VP5 0x02420000 | |
| #define BUF_VIDEO_VP6 0x02430000 | | #define BUF_VIDEO_VP6 0x02430000 | |
| #define BUF_VIDEO_VMD 0x02440000 | | #define BUF_VIDEO_VMD 0x02440000 | |
| #define BUF_VIDEO_MSZH 0x02450000 | | #define BUF_VIDEO_MSZH 0x02450000 | |
| #define BUF_VIDEO_ZLIB 0x02460000 | | #define BUF_VIDEO_ZLIB 0x02460000 | |
| #define BUF_VIDEO_8BPS 0x02470000 | | #define BUF_VIDEO_8BPS 0x02470000 | |
| #define BUF_VIDEO_ASV1 0x02480000 | | #define BUF_VIDEO_ASV1 0x02480000 | |
| #define BUF_VIDEO_ASV2 0x02490000 | | #define BUF_VIDEO_ASV2 0x02490000 | |
|
| #define BUF_VIDEO_BITPLANE 0x024A0000 /* Amiga typical picture and anim | | #define BUF_VIDEO_BITPLANE 0x024A0000 /**< Amiga typical picture and an | |
| ation format */ | | imation format */ | |
| #define BUF_VIDEO_BITPLANE_BR1 0x024B0000 /* the same with Bytrun compressi | | #define BUF_VIDEO_BITPLANE_BR1 0x024B0000 /**< the same with Bytrun compres | |
| on 1 */ | | sion 1 */ | |
| #define BUF_VIDEO_FLV1 0x024C0000 | | #define BUF_VIDEO_FLV1 0x024C0000 | |
| #define BUF_VIDEO_H264 0x024D0000 | | #define BUF_VIDEO_H264 0x024D0000 | |
| #define BUF_VIDEO_MJPEG_B 0x024E0000 | | #define BUF_VIDEO_MJPEG_B 0x024E0000 | |
| #define BUF_VIDEO_H261 0x024F0000 | | #define BUF_VIDEO_H261 0x024F0000 | |
| #define BUF_VIDEO_AASC 0x02500000 | | #define BUF_VIDEO_AASC 0x02500000 | |
| #define BUF_VIDEO_LOCO 0x02510000 | | #define BUF_VIDEO_LOCO 0x02510000 | |
| #define BUF_VIDEO_QDRW 0x02520000 | | #define BUF_VIDEO_QDRW 0x02520000 | |
| #define BUF_VIDEO_QPEG 0x02530000 | | #define BUF_VIDEO_QPEG 0x02530000 | |
| #define BUF_VIDEO_ULTI 0x02540000 | | #define BUF_VIDEO_ULTI 0x02540000 | |
| #define BUF_VIDEO_WNV1 0x02550000 | | #define BUF_VIDEO_WNV1 0x02550000 | |
| | | | |
| skipping to change at line 193 | | skipping to change at line 195 | |
| #define BUF_VIDEO_NUV 0x025F0000 | | #define BUF_VIDEO_NUV 0x025F0000 | |
| #define BUF_VIDEO_KMVC 0x02600000 | | #define BUF_VIDEO_KMVC 0x02600000 | |
| #define BUF_VIDEO_FLASHSV 0x02610000 | | #define BUF_VIDEO_FLASHSV 0x02610000 | |
| #define BUF_VIDEO_CAVS 0x02620000 | | #define BUF_VIDEO_CAVS 0x02620000 | |
| #define BUF_VIDEO_VP6F 0x02630000 | | #define BUF_VIDEO_VP6F 0x02630000 | |
| #define BUF_VIDEO_THEORA_RAW 0x02640000 | | #define BUF_VIDEO_THEORA_RAW 0x02640000 | |
| #define BUF_VIDEO_VC1 0x02650000 | | #define BUF_VIDEO_VC1 0x02650000 | |
| #define BUF_VIDEO_VMNC 0x02660000 | | #define BUF_VIDEO_VMNC 0x02660000 | |
| #define BUF_VIDEO_SNOW 0x02670000 | | #define BUF_VIDEO_SNOW 0x02670000 | |
| #define BUF_VIDEO_VP8 0x02680000 | | #define BUF_VIDEO_VP8 0x02680000 | |
|
| | | /*@}*/ | |
| | | | |
|
| /* audio buffer types: (please keep in sync with buffer_types.c) */ | | /** | |
| | | * @defgroup buffer_audio Audio buffer types | |
| | | * @note (please keep in sync with buffer_types.c) | |
| | | */ | |
| | | /*@{*/ | |
| #define BUF_AUDIO_BASE 0x03000000 | | #define BUF_AUDIO_BASE 0x03000000 | |
|
| #define BUF_AUDIO_UNKNOWN 0x03ff0000 /* no decoder should handle this
one */ | | #define BUF_AUDIO_UNKNOWN 0x03ff0000 /**< no decoder should handle thi
s one */ | |
| #define BUF_AUDIO_A52 0x03000000 | | #define BUF_AUDIO_A52 0x03000000 | |
| #define BUF_AUDIO_MPEG 0x03010000 | | #define BUF_AUDIO_MPEG 0x03010000 | |
| #define BUF_AUDIO_LPCM_BE 0x03020000 | | #define BUF_AUDIO_LPCM_BE 0x03020000 | |
| #define BUF_AUDIO_LPCM_LE 0x03030000 | | #define BUF_AUDIO_LPCM_LE 0x03030000 | |
| #define BUF_AUDIO_WMAV1 0x03040000 | | #define BUF_AUDIO_WMAV1 0x03040000 | |
| #define BUF_AUDIO_DTS 0x03050000 | | #define BUF_AUDIO_DTS 0x03050000 | |
| #define BUF_AUDIO_MSADPCM 0x03060000 | | #define BUF_AUDIO_MSADPCM 0x03060000 | |
| #define BUF_AUDIO_MSIMAADPCM 0x03070000 | | #define BUF_AUDIO_MSIMAADPCM 0x03070000 | |
| #define BUF_AUDIO_MSGSM 0x03080000 | | #define BUF_AUDIO_MSGSM 0x03080000 | |
| #define BUF_AUDIO_VORBIS 0x03090000 | | #define BUF_AUDIO_VORBIS 0x03090000 | |
| | | | |
| skipping to change at line 266 | | skipping to change at line 272 | |
| #define BUF_AUDIO_TRUESPEECH 0x03390000 | | #define BUF_AUDIO_TRUESPEECH 0x03390000 | |
| #define BUF_AUDIO_TTA 0x033A0000 | | #define BUF_AUDIO_TTA 0x033A0000 | |
| #define BUF_AUDIO_SMACKER 0x033B0000 | | #define BUF_AUDIO_SMACKER 0x033B0000 | |
| #define BUF_AUDIO_FLVADPCM 0x033C0000 | | #define BUF_AUDIO_FLVADPCM 0x033C0000 | |
| #define BUF_AUDIO_WAVPACK 0x033D0000 | | #define BUF_AUDIO_WAVPACK 0x033D0000 | |
| #define BUF_AUDIO_MP3ADU 0x033E0000 | | #define BUF_AUDIO_MP3ADU 0x033E0000 | |
| #define BUF_AUDIO_AMR_NB 0x033F0000 | | #define BUF_AUDIO_AMR_NB 0x033F0000 | |
| #define BUF_AUDIO_AMR_WB 0x03400000 | | #define BUF_AUDIO_AMR_WB 0x03400000 | |
| #define BUF_AUDIO_EAC3 0x03410000 | | #define BUF_AUDIO_EAC3 0x03410000 | |
| #define BUF_AUDIO_AAC_LATM 0x03420000 | | #define BUF_AUDIO_AAC_LATM 0x03420000 | |
|
| | | /*@}*/ | |
| | | | |
|
| /* spu buffer types: */ | | /** | |
| | | * @defgroup buffer_spu SPU buffer types | |
| | | */ | |
| | | /*@{*/ | |
| #define BUF_SPU_BASE 0x04000000 | | #define BUF_SPU_BASE 0x04000000 | |
| #define BUF_SPU_DVD 0x04000000 | | #define BUF_SPU_DVD 0x04000000 | |
| #define BUF_SPU_TEXT 0x04010000 | | #define BUF_SPU_TEXT 0x04010000 | |
| #define BUF_SPU_CC 0x04020000 | | #define BUF_SPU_CC 0x04020000 | |
| #define BUF_SPU_DVB 0x04030000 | | #define BUF_SPU_DVB 0x04030000 | |
| #define BUF_SPU_SVCD 0x04040000 | | #define BUF_SPU_SVCD 0x04040000 | |
| #define BUF_SPU_CVD 0x04050000 | | #define BUF_SPU_CVD 0x04050000 | |
| #define BUF_SPU_OGM 0x04060000 | | #define BUF_SPU_OGM 0x04060000 | |
| #define BUF_SPU_CMML 0x04070000 | | #define BUF_SPU_CMML 0x04070000 | |
| #define BUF_SPU_HDMV 0x04080000 | | #define BUF_SPU_HDMV 0x04080000 | |
|
| | | /*@}*/ | |
| | | | |
|
| /* demuxer block types: */ | | /** | |
| | | * @defgroup buffer_demux Demuxer block types | |
| | | */ | |
| | | /*@{*/ | |
| #define BUF_DEMUX_BLOCK 0x05000000 | | #define BUF_DEMUX_BLOCK 0x05000000 | |
|
| | | /*@}*/ | |
| | | | |
| | | /*@}*/ | |
| | | | |
| typedef struct extra_info_s extra_info_t; | | typedef struct extra_info_s extra_info_t; | |
| | | | |
|
| /* | | /** | |
| * extra_info_t is used to pass information from input or demuxer plugins | | * @brief Structure to pass information from input or demuxer plugins | |
| * to output frames (past decoder). new data must be added after the existi | | * to output frames (past decoder). | |
| ng | | * | |
| * fields for backward compatibility. | | * New data must be added after the existing fields to not break ABI | |
| | | * (backward compatibility). | |
| */ | | */ | |
| | | | |
| struct extra_info_s { | | struct extra_info_s { | |
| | | | |
|
| int input_normpos; /* remember where this buf came from | | int input_normpos; /**< remember where this buf came fr | |
| in | | om in | |
| * the input source (0..65535). can | | * the input source (0..65535). ca | |
| be | | n be | |
| * either time or offset based. */ | | * either time or offset based. */ | |
| int input_time; /* time offset in miliseconds from | | int input_time; /**< time offset in miliseconds from | |
| * beginning of stream */ | | * beginning of stream */ | |
| uint32_t frame_number; /* number of current frame if known | | uint32_t frame_number; /**< number of current frame if know | |
| */ | | n */ | |
| | | | |
|
| int seek_count; /* internal engine use */ | | int seek_count; /**< internal engine use */ | |
| int64_t vpts; /* set on output layers only */ | | int64_t vpts; /**< set on output layers only */ | |
| | | | |
|
| int invalid; /* do not use this extra info to upd | | int invalid; /**< do not use this extra info to u | |
| ate anything */ | | pdate anything */ | |
| int total_time; /* duration in miliseconds of the st | | int total_time; /**< duration in miliseconds of the | |
| ream */ | | stream */ | |
| }; | | }; | |
| | | | |
| #define BUF_NUM_DEC_INFO 5 | | #define BUF_NUM_DEC_INFO 5 | |
| | | | |
| typedef struct buf_element_s buf_element_t; | | typedef struct buf_element_s buf_element_t; | |
| struct buf_element_s { | | struct buf_element_s { | |
| buf_element_t *next; | | buf_element_t *next; | |
| | | | |
| unsigned char *mem; | | unsigned char *mem; | |
|
| unsigned char *content; /* start of raw content in mem (without
header etc) */ | | unsigned char *content; /**< start of raw content in mem (withou
t header etc) */ | |
| | | | |
|
| int32_t size ; /* size of _content_ | | int32_t size ; /**< size of _content_ | |
| */ | | */ | |
| int32_t max_size; /* size of pre-allocated memory pointed | | int32_t max_size; /**< size of pre-allocated memory pointe | |
| to by "mem" */ | | d to by "mem" */ | |
| uint32_t type; | | int64_t pts; /**< presentation time stamp, used for a | |
| int64_t pts; /* presentation time stamp, used for a/v | | /v sync */ | |
| sync */ | | int64_t disc_off; /**< discontinuity offset | |
| int64_t disc_off; /* discontinuity offset | | */ | |
| */ | | | |
| | | | |
|
| extra_info_t *extra_info; /* extra info will be passed to frames
*/ | | extra_info_t *extra_info; /**< extra info will be passed to frame
s */ | |
| | | | |
|
| uint32_t decoder_flags; /* stuff like keyframe, is_header ..
. see below */ | | uint32_t decoder_flags; /**< stuff like keyframe, is_header
... see below */ | |
| | | | |
|
| /* additional decoder flags and other dec-spec. stu
ff */ | | /** additional decoder flags and other dec-spec. stuff */ | |
| uint32_t decoder_info[BUF_NUM_DEC_INFO]; | | uint32_t decoder_info[BUF_NUM_DEC_INFO]; | |
|
| /* pointers to dec-spec. stuff */ | | /** pointers to dec-spec. stuff */ | |
| void *decoder_info_ptr[BUF_NUM_DEC_INFO]; | | void *decoder_info_ptr[BUF_NUM_DEC_INFO]; | |
| | | | |
| void (*free_buffer) (buf_element_t *buf); | | void (*free_buffer) (buf_element_t *buf); | |
| | | | |
|
| void *source; /* pointer to source of this buffer for * | | void *source; /**< pointer to source of this buffer for | |
| / | | * free_buffer | |
| /* free_buffer * | | */ | |
| / | | | |
| | | | |
|
| | | uint32_t type; | |
| } ; | | } ; | |
| | | | |
|
| /* keyframe should be set whenever possible (that is, when demuxer | | /** keyframe should be set whenever possible (that is, when demuxer | |
| * knows about frames and keyframes). */ | | * knows about frames and keyframes). */ | |
| #define BUF_FLAG_KEYFRAME 0x0001 | | #define BUF_FLAG_KEYFRAME 0x0001 | |
| | | | |
|
| /* frame start/end. BUF_FLAG_FRAME_END is sent on last buf of a frame */ | | /** frame start/end. BUF_FLAG_FRAME_END is sent on last buf of a frame */ | |
| #define BUF_FLAG_FRAME_START 0x0002 | | #define BUF_FLAG_FRAME_START 0x0002 | |
| #define BUF_FLAG_FRAME_END 0x0004 | | #define BUF_FLAG_FRAME_END 0x0004 | |
| | | | |
|
| /* any out-of-band data needed to initialize decoder must have | | /** any out-of-band data needed to initialize decoder must have | |
| * this flag set. */ | | * this flag set. */ | |
| #define BUF_FLAG_HEADER 0x0008 | | #define BUF_FLAG_HEADER 0x0008 | |
| | | | |
|
| /* preview buffers are normal data buffers that must not produce any | | /** preview buffers are normal data buffers that must not produce any | |
| * output in decoders (may be used to sneak details about the stream | | * output in decoders (may be used to sneak details about the stream | |
| * to come). */ | | * to come). */ | |
| #define BUF_FLAG_PREVIEW 0x0010 | | #define BUF_FLAG_PREVIEW 0x0010 | |
| | | | |
|
| /* set when user stop the playback */ | | /** set when user stop the playback */ | |
| #define BUF_FLAG_END_USER 0x0020 | | #define BUF_FLAG_END_USER 0x0020 | |
| | | | |
|
| /* set when stream finished naturaly */ | | /** set when stream finished naturaly */ | |
| #define BUF_FLAG_END_STREAM 0x0040 | | #define BUF_FLAG_END_STREAM 0x0040 | |
| | | | |
|
| /* decoder_info[0] carries the frame step (1/90000). */ | | /** decoder_info[0] carries the frame step (1/90000). */ | |
| #define BUF_FLAG_FRAMERATE 0x0080 | | #define BUF_FLAG_FRAMERATE 0x0080 | |
| | | | |
|
| /* hint to metronom that seeking has occurred */ | | /** hint to metronom that seeking has occurred */ | |
| #define BUF_FLAG_SEEK 0x0100 | | #define BUF_FLAG_SEEK 0x0100 | |
| | | | |
|
| /* special information inside, see below. */ | | /** special information inside, see below. */ | |
| #define BUF_FLAG_SPECIAL 0x0200 | | #define BUF_FLAG_SPECIAL 0x0200 | |
| | | | |
|
| /* header use standard xine_bmiheader or xine_waveformatex structs. | | /** header use standard xine_bmiheader or xine_waveformatex structs. | |
| * xine_waveformatex is actually optional since the most important | | * xine_waveformatex is actually optional since the most important | |
| * information for audio init is available from decoder_info[]. | | * information for audio init is available from decoder_info[]. | |
| * note: BUF_FLAG_HEADER must also be set. */ | | * note: BUF_FLAG_HEADER must also be set. */ | |
| #define BUF_FLAG_STDHEADER 0x0400 | | #define BUF_FLAG_STDHEADER 0x0400 | |
| | | | |
|
| /* decoder_info[1] carries numerator for display aspect ratio | | /** decoder_info[1] carries numerator for display aspect ratio | |
| * decoder_info[2] carries denominator for display aspect ratio */ | | * decoder_info[2] carries denominator for display aspect ratio */ | |
| #define BUF_FLAG_ASPECT 0x0800 | | #define BUF_FLAG_ASPECT 0x0800 | |
| | | | |
| /* represent the state of gapless_switch at the time buf was enqueued */ | | /* represent the state of gapless_switch at the time buf was enqueued */ | |
| #define BUF_FLAG_GAPLESS_SW 0x1000 | | #define BUF_FLAG_GAPLESS_SW 0x1000 | |
| | | | |
| /* Amount of audio padding added by encoder (mp3, aac). These empty | | /* Amount of audio padding added by encoder (mp3, aac). These empty | |
| * audio frames are causing a gap when switching between mp3 files. | | * audio frames are causing a gap when switching between mp3 files. | |
| * decoder_info[1] carries amount of audio frames padded at the | | * decoder_info[1] carries amount of audio frames padded at the | |
| * beginning of the buffer | | * beginning of the buffer | |
| * decoder_info[2] carries amount of audio frames padded at the end of | | * decoder_info[2] carries amount of audio frames padded at the end of | |
| * the buffer */ | | * the buffer */ | |
| #define BUF_FLAG_AUDIO_PADDING 0x2000 | | #define BUF_FLAG_AUDIO_PADDING 0x2000 | |
| | | | |
|
| /* Special buffer types: | | /** | |
| | | * \defgroup buffer_special Special buffer types: | |
| * Sometimes there is a need to relay special information from a demuxer | | * Sometimes there is a need to relay special information from a demuxer | |
| * to a video decoder. For example, some file types store palette data in | | * to a video decoder. For example, some file types store palette data in | |
| * the file header independant of the video data. The special buffer type | | * the file header independant of the video data. The special buffer type | |
| * offers a way to communicate this or any other custom, format-specific | | * offers a way to communicate this or any other custom, format-specific | |
| * data to the decoder. | | * data to the decoder. | |
| * | | * | |
| * The interface was designed in a way that did not require an API | | * The interface was designed in a way that did not require an API | |
| * version bump. To send a special buffer type, set a buffer's flags field | | * version bump. To send a special buffer type, set a buffer's flags field | |
| * to BUF_FLAG_SPECIAL. Set the buffer's decoder_info[1] field to a | | * to BUF_FLAG_SPECIAL. Set the buffer's decoder_info[1] field to a | |
| * number according to one of the special buffer subtypes defined below. | | * number according to one of the special buffer subtypes defined below. | |
| * The second and third decoder_info[] fields are defined according to | | * The second and third decoder_info[] fields are defined according to | |
| * your buffer type's requirements. | | * your buffer type's requirements. | |
| * | | * | |
| * Finally, remember to set the buffer's size to 0. This way, if a special | | * Finally, remember to set the buffer's size to 0. This way, if a special | |
| * buffer is sent to a decode that does not know how to handle it, the | | * buffer is sent to a decode that does not know how to handle it, the | |
| * buffer will fall through to the case where the buffer's data content | | * buffer will fall through to the case where the buffer's data content | |
| * is accumulated and no harm will be done. | | * is accumulated and no harm will be done. | |
| */ | | */ | |
|
| | | /*@{*/ | |
| | | | |
|
| /* these are the types of special buffers */ | | /** | |
| | | | |
| /* | | | |
| * In a BUF_SPECIAL_PALETTE buffer: | | * In a BUF_SPECIAL_PALETTE buffer: | |
| * decoder_info[1] = BUF_SPECIAL_PALETTE | | * decoder_info[1] = BUF_SPECIAL_PALETTE | |
| * decoder_info[2] = number of entries in palette table | | * decoder_info[2] = number of entries in palette table | |
| * decoder_info_ptr[2] = pointer to palette table | | * decoder_info_ptr[2] = pointer to palette table | |
| * This buffer type is used to provide a file- and decoder-independent | | * This buffer type is used to provide a file- and decoder-independent | |
| * facility to transport RGB color palettes from demuxers to decoders. | | * facility to transport RGB color palettes from demuxers to decoders. | |
| * A palette table is an array of palette_entry_t structures. A decoder | | * A palette table is an array of palette_entry_t structures. A decoder | |
| * should not count on this array to exist for the duration of the | | * should not count on this array to exist for the duration of the | |
| * program's execution and should copy, manipulate, and store the palette | | * program's execution and should copy, manipulate, and store the palette | |
| * data privately if it needs the palette information. | | * data privately if it needs the palette information. | |
| */ | | */ | |
| #define BUF_SPECIAL_PALETTE 1 | | #define BUF_SPECIAL_PALETTE 1 | |
| | | | |
| /* special buffer type 2 used to be defined but is now available for use */ | | /* special buffer type 2 used to be defined but is now available for use */ | |
| | | | |
|
| /* | | /** | |
| * In a BUF_SPECIAL_ASPECT buffer: | | * In a BUF_SPECIAL_ASPECT buffer: | |
| * decoder_info[1] = BUF_SPECIAL_ASPECT | | * decoder_info[1] = BUF_SPECIAL_ASPECT | |
| * decoder_info[2] = MPEG2 aspect ratio code | | * decoder_info[2] = MPEG2 aspect ratio code | |
| * decoder_info[3] = stream scale prohibitions | | * decoder_info[3] = stream scale prohibitions | |
| * This buffer is used to force mpeg decoders to use a certain aspect. | | * This buffer is used to force mpeg decoders to use a certain aspect. | |
| * Currently xine-dvdnav uses this, because it has more accurate informatio
n | | * Currently xine-dvdnav uses this, because it has more accurate informatio
n | |
| * about the aspect from the dvd ifo-data. | | * about the aspect from the dvd ifo-data. | |
| * The stream scale prohibitions are also delivered, with bit 0 meaning | | * The stream scale prohibitions are also delivered, with bit 0 meaning | |
| * "deny letterboxing" and bit 1 meaning "deny pan&scan" | | * "deny letterboxing" and bit 1 meaning "deny pan&scan" | |
| */ | | */ | |
| #define BUF_SPECIAL_ASPECT 3 | | #define BUF_SPECIAL_ASPECT 3 | |
| | | | |
|
| /* | | /** | |
| * In a BUF_SPECIAL_DECODER_CONFIG buffer: | | * In a BUF_SPECIAL_DECODER_CONFIG buffer: | |
| * decoder_info[1] = BUF_SPECIAL_DECODER_CONFIG | | * decoder_info[1] = BUF_SPECIAL_DECODER_CONFIG | |
| * decoder_info[2] = data size | | * decoder_info[2] = data size | |
| * decoder_info_ptr[2] = pointer to data | | * decoder_info_ptr[2] = pointer to data | |
| * This buffer is used to pass config information from .mp4 files | | * This buffer is used to pass config information from .mp4 files | |
| * (atom esds) to decoders. both mpeg4 and aac streams use that. | | * (atom esds) to decoders. both mpeg4 and aac streams use that. | |
| */ | | */ | |
| #define BUF_SPECIAL_DECODER_CONFIG 4 | | #define BUF_SPECIAL_DECODER_CONFIG 4 | |
| | | | |
|
| /* | | /** | |
| * In a BUF_SPECIAL_STSD_ATOM buffer: | | * In a BUF_SPECIAL_STSD_ATOM buffer: | |
| * decoder_info[1] = BUF_SPECIAL_STSD_ATOM | | * decoder_info[1] = BUF_SPECIAL_STSD_ATOM | |
| * decoder_info[2] = size of the ImageDescription atom, minus the | | * decoder_info[2] = size of the ImageDescription atom, minus the | |
| * four length bytes at the beginning | | * four length bytes at the beginning | |
| * decoder_info_ptr[2] = pointer to ImageDescription atom, starting with | | * decoder_info_ptr[2] = pointer to ImageDescription atom, starting with | |
| * the codec fourcc | | * the codec fourcc | |
| * Some Quicktime decoders need information contained within the | | * Some Quicktime decoders need information contained within the | |
| * ImageDescription atom inside a Quicktime file's stsd atom. This | | * ImageDescription atom inside a Quicktime file's stsd atom. This | |
| * special buffer carries the ImageDescription atom from the QT demuxer | | * special buffer carries the ImageDescription atom from the QT demuxer | |
| * to an A/V decoder. | | * to an A/V decoder. | |
| */ | | */ | |
| #define BUF_SPECIAL_STSD_ATOM 5 | | #define BUF_SPECIAL_STSD_ATOM 5 | |
| | | | |
|
| /* | | /** | |
| * In a BUF_SPECIAL_LPCM_CONFIG buffer: | | * In a BUF_SPECIAL_LPCM_CONFIG buffer: | |
| * decoder_info[1] = BUF_SPECIAL_LPCM_CONFIG | | * decoder_info[1] = BUF_SPECIAL_LPCM_CONFIG | |
| * decoder_info[2] = config data | | * decoder_info[2] = config data | |
| * lpcm data encoded into mpeg2 streams have a format configuration | | * lpcm data encoded into mpeg2 streams have a format configuration | |
| * byte in every frame. this is used to detect the sample rate, | | * byte in every frame. this is used to detect the sample rate, | |
| * number of bits and channels. | | * number of bits and channels. | |
| */ | | */ | |
| #define BUF_SPECIAL_LPCM_CONFIG 6 | | #define BUF_SPECIAL_LPCM_CONFIG 6 | |
| | | | |
|
| /* | | /** | |
| * In a BUF_SPECIAL_CHARSET_ENCODING buffer: | | * In a BUF_SPECIAL_CHARSET_ENCODING buffer: | |
| * decoder_info[1] = BUF_SPECIAL_CHARSET_ENCODING | | * decoder_info[1] = BUF_SPECIAL_CHARSET_ENCODING | |
| * decoder_info[2] = size of charset encoding string | | * decoder_info[2] = size of charset encoding string | |
| * decoder_info_ptr[2] = pointer to charset encoding string | | * decoder_info_ptr[2] = pointer to charset encoding string | |
| * This is used mostly with subtitle buffers when encoding is | | * This is used mostly with subtitle buffers when encoding is | |
| * known at demuxer level (take precedence over xine config | | * known at demuxer level (take precedence over xine config | |
| * settings such as subtitles.separate.src_encoding) | | * settings such as subtitles.separate.src_encoding) | |
| */ | | */ | |
| #define BUF_SPECIAL_CHARSET_ENCODING 7 | | #define BUF_SPECIAL_CHARSET_ENCODING 7 | |
| | | | |
|
| /* | | /** | |
| * In a BUF_SPECIAL_SPU_DVD_SUBTYPE: | | * In a BUF_SPECIAL_SPU_DVD_SUBTYPE: | |
| * decoder_info[1] = BUF_SPECIAL_SPU_DVD_SUBTYPE | | * decoder_info[1] = BUF_SPECIAL_SPU_DVD_SUBTYPE | |
| * decoder_info[2] = subtype | | * decoder_info[2] = subtype | |
| * decoder_info[3] = | | * decoder_info[3] = | |
| * This buffer is pass SPU subtypes from DVDs | | * This buffer is pass SPU subtypes from DVDs | |
| */ | | */ | |
| #define BUF_SPECIAL_SPU_DVD_SUBTYPE 8 | | #define BUF_SPECIAL_SPU_DVD_SUBTYPE 8 | |
| | | | |
| #define SPU_DVD_SUBTYPE_CLUT 1 | | #define SPU_DVD_SUBTYPE_CLUT 1 | |
| #define SPU_DVD_SUBTYPE_PACKAGE 2 | | #define SPU_DVD_SUBTYPE_PACKAGE 2 | |
| #define SPU_DVD_SUBTYPE_VOBSUB_PACKAGE 3 | | #define SPU_DVD_SUBTYPE_VOBSUB_PACKAGE 3 | |
| #define SPU_DVD_SUBTYPE_NAV 4 | | #define SPU_DVD_SUBTYPE_NAV 4 | |
| | | | |
|
| /* In a BUF_SPECIAL_SPU_DVB_DESCRIPTOR | | /** | |
| | | * In a BUF_SPECIAL_SPU_DVB_DESCRIPTOR | |
| * decoder_info[1] = BUF_SPECIAL_SPU_DVB_DESCRIPTOR | | * decoder_info[1] = BUF_SPECIAL_SPU_DVB_DESCRIPTOR | |
| * decoder_info[2] = size of spu_dvb_descriptor_t | | * decoder_info[2] = size of spu_dvb_descriptor_t | |
| * decoder_info_ptr[2] = pointer to spu_dvb_descriptor_t, or NULL | | * decoder_info_ptr[2] = pointer to spu_dvb_descriptor_t, or NULL | |
| * decoder_info[3] = | | * decoder_info[3] = | |
| * | | * | |
| * This buffer is used to tell a DVBSUB decoder when the stream | | * This buffer is used to tell a DVBSUB decoder when the stream | |
| * changes. For more information on how to write a DVBSUB decoder, | | * changes. For more information on how to write a DVBSUB decoder, | |
| * see the comment at the top of src/demuxers/demux_ts.c | | * see the comment at the top of src/demuxers/demux_ts.c | |
| **/ | | **/ | |
| #define BUF_SPECIAL_SPU_DVB_DESCRIPTOR 9 | | #define BUF_SPECIAL_SPU_DVB_DESCRIPTOR 9 | |
| | | | |
|
| /* | | /** | |
| * In a BUF_SPECIAL_RV_CHUNK_TABLE: | | * In a BUF_SPECIAL_RV_CHUNK_TABLE: | |
| * decoder_info[1] = BUF_SPECIAL_RV_CHUNK_TABLE | | * decoder_info[1] = BUF_SPECIAL_RV_CHUNK_TABLE | |
| * decoder_info[2] = number of entries in chunk table | | * decoder_info[2] = number of entries in chunk table | |
| * decoder_info_ptr[2] = pointer to the chunk table | | * decoder_info_ptr[2] = pointer to the chunk table | |
| * | | * | |
| * This buffer transports the chunk table associated to each RealVideo fram
e. | | * This buffer transports the chunk table associated to each RealVideo fram
e. | |
| */ | | */ | |
| #define BUF_SPECIAL_RV_CHUNK_TABLE 10 | | #define BUF_SPECIAL_RV_CHUNK_TABLE 10 | |
|
| | | /*@}*/ | |
| | | | |
| typedef struct spu_dvb_descriptor_s spu_dvb_descriptor_t; | | typedef struct spu_dvb_descriptor_s spu_dvb_descriptor_t; | |
| struct spu_dvb_descriptor_s | | struct spu_dvb_descriptor_s | |
| { | | { | |
| char lang[4]; | | char lang[4]; | |
| long comp_page_id; | | long comp_page_id; | |
| long aux_page_id; | | long aux_page_id; | |
| } ; | | } ; | |
| | | | |
| typedef struct palette_entry_s palette_entry_t; | | typedef struct palette_entry_s palette_entry_t; | |
| | | | |
| skipping to change at line 613 | | skipping to change at line 632 | |
| int buffer_pool_buf_size; | | int buffer_pool_buf_size; | |
| void *buffer_pool_base; /*used to free mem chunk */ | | void *buffer_pool_base; /*used to free mem chunk */ | |
| void (*alloc_cb[BUF_MAX_CALLBACKS])(fifo_buffer_t *fifo, void *
data_cb); | | void (*alloc_cb[BUF_MAX_CALLBACKS])(fifo_buffer_t *fifo, void *
data_cb); | |
| void (*put_cb[BUF_MAX_CALLBACKS])(fifo_buffer_t *fifo, buf_elem
ent_t *buf, void *data_cb); | | void (*put_cb[BUF_MAX_CALLBACKS])(fifo_buffer_t *fifo, buf_elem
ent_t *buf, void *data_cb); | |
| void (*get_cb[BUF_MAX_CALLBACKS])(fifo_buffer_t *fifo, buf_elem
ent_t *buf, void *data_cb); | | void (*get_cb[BUF_MAX_CALLBACKS])(fifo_buffer_t *fifo, buf_elem
ent_t *buf, void *data_cb); | |
| void *alloc_cb_data[BUF_MAX_CALLBACKS]; | | void *alloc_cb_data[BUF_MAX_CALLBACKS]; | |
| void *put_cb_data[BUF_MAX_CALLBACKS]; | | void *put_cb_data[BUF_MAX_CALLBACKS]; | |
| void *get_cb_data[BUF_MAX_CALLBACKS]; | | void *get_cb_data[BUF_MAX_CALLBACKS]; | |
| } ; | | } ; | |
| | | | |
|
| /* | | /** | |
| * allocate and initialize new (empty) fifo buffer, | | * @brief Allocate and initialise new (empty) FIFO buffers. | |
| * init buffer pool for it: | | * @param num_buffer Number of buffers to allocate. | |
| * allocate num_buffers of buf_size bytes each | | * @param buf_size Size of each buffer. | |
| | | * @internal Only used by video and audio decoder loops. | |
| */ | | */ | |
|
| | | fifo_buffer_t *_x_fifo_buffer_new (int num_buffers, uint32_t buf_size) XINE
_MALLOC; | |
| | | | |
|
| fifo_buffer_t *_x_fifo_buffer_new (int num_buffers, uint32_t buf_size) XINE | | /** | |
| _MALLOC XINE_PROTECTED; | | * @brief Allocate and initialise new dummy FIFO buffers. | |
| fifo_buffer_t *_x_dummy_fifo_buffer_new (int num_buffers, uint32_t buf_size | | * @param num_buffer Number of dummy buffers to allocate. | |
| ) XINE_MALLOC XINE_PROTECTED; | | * @param buf_size Size of each buffer. | |
| | | * @internal Only used by video and audio decoder loops. | |
| | | */ | |
| | | fifo_buffer_t *_x_dummy_fifo_buffer_new (int num_buffers, uint32_t buf_size | |
| | | ) XINE_MALLOC; | |
| | | | |
|
| /* return BUF_VIDEO_xxx given the fourcc | | /** | |
| * fourcc_int must be read in machine endianness | | * @brief Returns the \ref buffer_video "BUF_VIDEO_xxx" for the given fourc | |
| | | c. | |
| | | * @param fourcc_int 32-bit FOURCC value in machine endianness | |
| | | * @sa _x_formattag_to_buf_audio | |
| | | * | |
| * example: fourcc_int = *(uint32_t *)fourcc_char; | | * example: fourcc_int = *(uint32_t *)fourcc_char; | |
| */ | | */ | |
| uint32_t _x_fourcc_to_buf_video( uint32_t fourcc_int ) XINE_PROTECTED; | | uint32_t _x_fourcc_to_buf_video( uint32_t fourcc_int ) XINE_PROTECTED; | |
| | | | |
|
| /* return codec name given BUF_VIDEO_xxx */ | | /** | |
| | | * @brief Returns video codec name given the buffer type. | |
| | | * @param buf_type One of the \ref buffer_video "BUF_VIDEO_xxx" values. | |
| | | * @sa _x_buf_audio_name | |
| | | */ | |
| const char * _x_buf_video_name( uint32_t buf_type ) XINE_PROTECTED; | | const char * _x_buf_video_name( uint32_t buf_type ) XINE_PROTECTED; | |
| | | | |
|
| /* return BUF_AUDIO_xxx given the formattag */ | | /** | |
| | | * @brief Returns the \ref buffer_audio "BUF_AUDIO_xxx" for the given forma | |
| | | ttag. | |
| | | * @param formattagg 32-bit format tag value in machine endianness | |
| | | * @sa _x_fourcc_to_buf_video | |
| | | */ | |
| uint32_t _x_formattag_to_buf_audio( uint32_t formattag ) XINE_PROTECTED; | | uint32_t _x_formattag_to_buf_audio( uint32_t formattag ) XINE_PROTECTED; | |
| | | | |
|
| /* return codec name given BUF_AUDIO_xxx */ | | /** | |
| | | * @brief Returns audio codec name given the buffer type. | |
| | | * @param buf_type One of the \ref buffer_audio "BUF_AUDIO_xxx" values. | |
| | | * @sa _x_buf_video_name | |
| | | */ | |
| const char * _x_buf_audio_name( uint32_t buf_type ) XINE_PROTECTED; | | const char * _x_buf_audio_name( uint32_t buf_type ) XINE_PROTECTED; | |
| | | | |
|
| #ifndef SUPPORT_ATTRIBUTE_PACKED | | /** | |
| /* no attribute packed? let's try with pragma pack as a last resort */ | | * @brief xine version of BITMAPINFOHEADER. | |
| #pragma pack(2) | | * @note Should be safe to compile on 64bits machines. | |
| #endif | | * @note Will always use machine endian format, so demuxers reading | |
| /* this is xine version of BITMAPINFOHEADER | | * stuff from win32 formats must use the function below. | |
| * - should be safe to compile on 64bits machines | | | |
| * - will always use machine endian format, so demuxers reading | | | |
| * stuff from win32 formats must use the function below. | | | |
| */ | | */ | |
| typedef struct XINE_PACKED { | | typedef struct XINE_PACKED { | |
| int32_t biSize; | | int32_t biSize; | |
| int32_t biWidth; | | int32_t biWidth; | |
| int32_t biHeight; | | int32_t biHeight; | |
| int16_t biPlanes; | | int16_t biPlanes; | |
| int16_t biBitCount; | | int16_t biBitCount; | |
| uint32_t biCompression; | | uint32_t biCompression; | |
| int32_t biSizeImage; | | int32_t biSizeImage; | |
| int32_t biXPelsPerMeter; | | int32_t biXPelsPerMeter; | |
| int32_t biYPelsPerMeter; | | int32_t biYPelsPerMeter; | |
| int32_t biClrUsed; | | int32_t biClrUsed; | |
| int32_t biClrImportant; | | int32_t biClrImportant; | |
| } xine_bmiheader; | | } xine_bmiheader; | |
| | | | |
|
| /* this is xine version of WAVEFORMATEX | | /** | |
| * (the same comments from xine_bmiheader) | | * @brief xine version of WAVEFORMATEX. | |
| | | * @note The same comments from xine_bmiheader applies. | |
| */ | | */ | |
| typedef struct XINE_PACKED { | | typedef struct XINE_PACKED { | |
| int16_t wFormatTag; | | int16_t wFormatTag; | |
| int16_t nChannels; | | int16_t nChannels; | |
| int32_t nSamplesPerSec; | | int32_t nSamplesPerSec; | |
| int32_t nAvgBytesPerSec; | | int32_t nAvgBytesPerSec; | |
| int16_t nBlockAlign; | | int16_t nBlockAlign; | |
| int16_t wBitsPerSample; | | int16_t wBitsPerSample; | |
| int16_t cbSize; | | int16_t cbSize; | |
| } xine_waveformatex; | | } xine_waveformatex; | |
|
| #ifndef SUPPORT_ATTRIBUTE_PACKED | | | |
| #pragma pack() | | | |
| #endif | | | |
| | | | |
|
| /* convert xine_bmiheader struct from little endian */ | | /** Convert xine_bmiheader struct from little endian */ | |
| void _x_bmiheader_le2me( xine_bmiheader *bih ) XINE_PROTECTED; | | void _x_bmiheader_le2me( xine_bmiheader *bih ) XINE_PROTECTED; | |
| | | | |
|
| /* convert xine_waveformatex struct from little endian */ | | /** Convert xine_waveformatex struct from little endian */ | |
| void _x_waveformatex_le2me( xine_waveformatex *wavex ) XINE_PROTECTED; | | void _x_waveformatex_le2me( xine_waveformatex *wavex ) XINE_PROTECTED; | |
| | | | |
|
| static __inline int _x_is_fourcc(void *ptr, void *tag) { | | static __inline int _x_is_fourcc(const void *ptr, const void *tag) { | |
| return memcmp(ptr, tag, 4) == 0; | | return memcmp(ptr, tag, 4) == 0; | |
| } | | } | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| } | | } | |
| #endif | | #endif | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 66 change blocks. |
| 117 lines changed or deleted | | 152 lines changed or added | |
|
| osd.h | | osd.h | |
| | | | |
| skipping to change at line 30 | | skipping to change at line 30 | |
| * OSD stuff (text and graphic primitives) | | * OSD stuff (text and graphic primitives) | |
| */ | | */ | |
| | | | |
| #ifndef HAVE_OSD_H | | #ifndef HAVE_OSD_H | |
| #define HAVE_OSD_H | | #define HAVE_OSD_H | |
| | | | |
| #ifdef HAVE_ICONV | | #ifdef HAVE_ICONV | |
| # include <iconv.h> | | # include <iconv.h> | |
| #endif | | #endif | |
| | | | |
|
| #ifdef XINE_COMPILE | | #include <xine/video_overlay.h> | |
| # include "video_overlay.h" | | | |
| # ifdef __OSD_C__ | | | |
| # include "alphablend.h" | | | |
| # endif | | | |
| #else | | | |
| # include <xine/video_overlay.h> | | | |
| #endif | | | |
| | | | |
| typedef struct osd_object_s osd_object_t; | | typedef struct osd_object_s osd_object_t; | |
| typedef struct osd_renderer_s osd_renderer_t; | | typedef struct osd_renderer_s osd_renderer_t; | |
| typedef struct osd_font_s osd_font_t; | | typedef struct osd_font_s osd_font_t; | |
| typedef struct osd_ft2context_s osd_ft2context_t; | | typedef struct osd_ft2context_s osd_ft2context_t; | |
| | | | |
| struct osd_object_s { | | struct osd_object_s { | |
| osd_object_t *next; | | osd_object_t *next; | |
| osd_renderer_t *renderer; | | osd_renderer_t *renderer; | |
| | | | |
| int width, height; /* work area dimentions */ | | int width, height; /* work area dimentions */ | |
| uint8_t *area; /* work area */ | | uint8_t *area; /* work area */ | |
|
| | | int area_touched; /* work area was used for painting */ | |
| int display_x,display_y; /* where to display it in screen */ | | int display_x,display_y; /* where to display it in screen */ | |
| | | | |
|
| | | /* video output area within osd extent */ | |
| | | int video_window_x, video_window_y; | |
| | | int video_window_width, video_window_height; | |
| | | | |
| | | /* extent of reference coordinate system */ | |
| | | int extent_width, extent_height; | |
| | | | |
| /* clipping box inside work area */ | | /* clipping box inside work area */ | |
| int x1, y1; | | int x1, y1; | |
| int x2, y2; | | int x2, y2; | |
| | | | |
| uint32_t color[OVL_PALETTE_SIZE]; /* color lookup table */ | | uint32_t color[OVL_PALETTE_SIZE]; /* color lookup table */ | |
| uint8_t trans[OVL_PALETTE_SIZE]; /* mixer key table */ | | uint8_t trans[OVL_PALETTE_SIZE]; /* mixer key table */ | |
| | | | |
|
| int32_t handle; | | | |
| | | | |
| #ifdef HAVE_ICONV | | #ifdef HAVE_ICONV | |
| iconv_t cd; /* iconv handle of encoding */ | | iconv_t cd; /* iconv handle of encoding */ | |
| char *encoding; /* name of encoding */ | | char *encoding; /* name of encoding */ | |
| #endif | | #endif | |
| | | | |
| osd_font_t *font; | | osd_font_t *font; | |
| osd_ft2context_t *ft2; | | osd_ft2context_t *ft2; | |
|
| | | | |
| | | /* this holds an optional ARGB overlay, which | |
| | | * is only be used by supported video_out modules. | |
| | | * right now this is only vdpau */ | |
| | | argb_layer_t *argb_layer; | |
| | | | |
| | | int32_t handle; | |
| }; | | }; | |
| | | | |
| /* this one is public */ | | /* this one is public */ | |
| struct xine_osd_s { | | struct xine_osd_s { | |
| osd_object_t osd; | | osd_object_t osd; | |
| }; | | }; | |
| | | | |
| struct osd_renderer_s { | | struct osd_renderer_s { | |
| | | | |
|
| | | xine_stream_t *stream; | |
| | | | |
| /* | | /* | |
| * open a new osd object. this will allocated an empty (all zero) drawing | | * open a new osd object. this will allocated an empty (all zero) drawing | |
| * area where graphic primitives may be used. | | * area where graphic primitives may be used. | |
| * It is ok to specify big width and height values. The render will keep | | * It is ok to specify big width and height values. The render will keep | |
| * track of the smallest changed area to not generate too big overlays. | | * track of the smallest changed area to not generate too big overlays. | |
| * A default palette is initialized (i sugest keeping color 0 as transpar
ent | | * A default palette is initialized (i sugest keeping color 0 as transpar
ent | |
| * for the sake of simplicity) | | * for the sake of simplicity) | |
| */ | | */ | |
| osd_object_t* (*new_object) (osd_renderer_t *this, int width, int height)
; | | osd_object_t* (*new_object) (osd_renderer_t *this, int width, int height)
; | |
| | | | |
| | | | |
| skipping to change at line 213 | | skipping to change at line 221 | |
| * the object is not changed. there may be subsequent drawing on it. | | * the object is not changed. there may be subsequent drawing on it. | |
| * overlay is blended at output (screen) resolution. | | * overlay is blended at output (screen) resolution. | |
| */ | | */ | |
| int (*show_unscaled) (osd_object_t *osd, int64_t vpts ); | | int (*show_unscaled) (osd_object_t *osd, int64_t vpts ); | |
| | | | |
| /* | | /* | |
| * see xine.h for defined XINE_OSD_CAP_ values. | | * see xine.h for defined XINE_OSD_CAP_ values. | |
| */ | | */ | |
| uint32_t (*get_capabilities) (osd_object_t *osd); | | uint32_t (*get_capabilities) (osd_object_t *osd); | |
| | | | |
|
| | | /* | |
| | | * define extent of reference coordinate system for video | |
| | | * resolution independent osds. both sizes must be > 0 to | |
| | | * take effect. otherwise, video resolution will be used. | |
| | | */ | |
| | | void (*set_extent) (osd_object_t *osd, int extent_width, int extent_heigh | |
| | | t); | |
| | | | |
| | | /* | |
| | | * set an argb buffer to be blended into video | |
| | | * the buffer must exactly match the osd dimensions | |
| | | * and stay valid while the osd is on screen. pass | |
| | | * a NULL pointer to safely remove the buffer from | |
| | | * the osd layer. only the dirty area will be | |
| | | * updated on screen. for convinience the whole | |
| | | * osd object will be considered dirty when setting | |
| | | * a different buffer pointer. | |
| | | * see also XINE_OSD_CAP_ARGB_LAYER | |
| | | */ | |
| | | void (*set_argb_buffer) (osd_object_t *osd, uint32_t *argb_buffer, | |
| | | int dirty_x, int dirty_y, int dirty_width, int d | |
| | | irty_height); | |
| | | | |
| | | /* | |
| | | * osd video window defines an area withing osd extent where the | |
| | | * video shall be scaled to while an osd is displayed on screen. | |
| | | * both width and height must be > 0 to take effect. | |
| | | */ | |
| | | void (*set_video_window) (osd_object_t *osd, | |
| | | int window_x, int window_y, int window_width, i | |
| | | nt window_height); | |
| | | | |
| /* private stuff */ | | /* private stuff */ | |
| | | | |
| pthread_mutex_t osd_mutex; | | pthread_mutex_t osd_mutex; | |
| video_overlay_event_t event; | | video_overlay_event_t event; | |
| osd_object_t *osds; /* instances of osd */ | | osd_object_t *osds; /* instances of osd */ | |
| osd_font_t *fonts; /* loaded fonts */ | | osd_font_t *fonts; /* loaded fonts */ | |
| int textpalette; /* default textpalette */ | | int textpalette; /* default textpalette */ | |
| | | | |
|
| xine_stream_t *stream; | | | |
| | | | |
| }; | | }; | |
| | | | |
| /* | | /* | |
| * initialize the osd rendering engine | | * initialize the osd rendering engine | |
| */ | | */ | |
| osd_renderer_t *_x_osd_renderer_init( xine_stream_t *stream ) XINE_MALLOC; | | osd_renderer_t *_x_osd_renderer_init( xine_stream_t *stream ) XINE_MALLOC; | |
| | | | |
| /* | | /* | |
| * The size of a text palette | | * The size of a text palette | |
| */ | | */ | |
| | | | |
| skipping to change at line 263 | | skipping to change at line 298 | |
| * Defined palettes for rendering osd text | | * Defined palettes for rendering osd text | |
| * (more can be added later) | | * (more can be added later) | |
| */ | | */ | |
| | | | |
| #define NUMBER_OF_TEXT_PALETTES 4 | | #define NUMBER_OF_TEXT_PALETTES 4 | |
| #define TEXTPALETTE_WHITE_BLACK_TRANSPARENT 0 | | #define TEXTPALETTE_WHITE_BLACK_TRANSPARENT 0 | |
| #define TEXTPALETTE_WHITE_NONE_TRANSPARENT 1 | | #define TEXTPALETTE_WHITE_NONE_TRANSPARENT 1 | |
| #define TEXTPALETTE_WHITE_NONE_TRANSLUCID 2 | | #define TEXTPALETTE_WHITE_NONE_TRANSLUCID 2 | |
| #define TEXTPALETTE_YELLOW_BLACK_TRANSPARENT 3 | | #define TEXTPALETTE_YELLOW_BLACK_TRANSPARENT 3 | |
| | | | |
|
| #ifdef __OSD_C__ | | | |
| | | | |
| /* This text descriptions are used for config screen */ | | | |
| static const char *textpalettes_str[NUMBER_OF_TEXT_PALETTES+1] = { | | | |
| "white-black-transparent", | | | |
| "white-none-transparent", | | | |
| "white-none-translucid", | | | |
| "yellow-black-transparent", | | | |
| NULL}; | | | |
| | | | |
| /* | | | |
| Palette entries as used by osd fonts: | | | |
| | | | |
| 0: not used by font, always transparent | | | |
| 1: font background, usually transparent, may be used to implement | | | |
| translucid boxes where the font will be printed. | | | |
| 2-5: transition between background and border (usually only alpha | | | |
| value changes). | | | |
| 6: font border. if the font is to be displayed without border this | | | |
| will probably be adjusted to font background or near. | | | |
| 7-9: transition between border and foreground | | | |
| 10: font color (foreground) | | | |
| */ | | | |
| | | | |
| /* | | | |
| The palettes below were made by hand, ie, i just throw | | | |
| values that seemed to do the transitions i wanted. | | | |
| This can surelly be improved a lot. [Miguel] | | | |
| */ | | | |
| | | | |
| static const clut_t textpalettes_color[NUMBER_OF_TEXT_PALETTES][TEXT_PALETT | | | |
| E_SIZE] = { | | | |
| /* white, black border, transparent */ | | | |
| { | | | |
| CLUT_Y_CR_CB_INIT(0x00, 0x00, 0x00), /*0*/ | | | |
| CLUT_Y_CR_CB_INIT(0x00, 0x80, 0x80), /*1*/ | | | |
| CLUT_Y_CR_CB_INIT(0x00, 0x80, 0x80), /*2*/ | | | |
| CLUT_Y_CR_CB_INIT(0x00, 0x80, 0x80), /*3*/ | | | |
| CLUT_Y_CR_CB_INIT(0x00, 0x80, 0x80), /*4*/ | | | |
| CLUT_Y_CR_CB_INIT(0x00, 0x80, 0x80), /*5*/ | | | |
| CLUT_Y_CR_CB_INIT(0x00, 0x80, 0x80), /*6*/ | | | |
| CLUT_Y_CR_CB_INIT(0x40, 0x80, 0x80), /*7*/ | | | |
| CLUT_Y_CR_CB_INIT(0x80, 0x80, 0x80), /*8*/ | | | |
| CLUT_Y_CR_CB_INIT(0xc0, 0x80, 0x80), /*9*/ | | | |
| CLUT_Y_CR_CB_INIT(0xff, 0x80, 0x80), /*10*/ | | | |
| }, | | | |
| /* white, no border, transparent */ | | | |
| { | | | |
| CLUT_Y_CR_CB_INIT(0x00, 0x00, 0x00), /*0*/ | | | |
| CLUT_Y_CR_CB_INIT(0xff, 0x80, 0x80), /*1*/ | | | |
| CLUT_Y_CR_CB_INIT(0xff, 0x80, 0x80), /*2*/ | | | |
| CLUT_Y_CR_CB_INIT(0xff, 0x80, 0x80), /*3*/ | | | |
| CLUT_Y_CR_CB_INIT(0xff, 0x80, 0x80), /*4*/ | | | |
| CLUT_Y_CR_CB_INIT(0xff, 0x80, 0x80), /*5*/ | | | |
| CLUT_Y_CR_CB_INIT(0xff, 0x80, 0x80), /*6*/ | | | |
| CLUT_Y_CR_CB_INIT(0xff, 0x80, 0x80), /*7*/ | | | |
| CLUT_Y_CR_CB_INIT(0xff, 0x80, 0x80), /*8*/ | | | |
| CLUT_Y_CR_CB_INIT(0xff, 0x80, 0x80), /*9*/ | | | |
| CLUT_Y_CR_CB_INIT(0xff, 0x80, 0x80), /*10*/ | | | |
| }, | | | |
| /* white, no border, translucid */ | | | |
| { | | | |
| CLUT_Y_CR_CB_INIT(0x00, 0x00, 0x00), /*0*/ | | | |
| CLUT_Y_CR_CB_INIT(0x80, 0x80, 0x80), /*1*/ | | | |
| CLUT_Y_CR_CB_INIT(0x80, 0x80, 0x80), /*2*/ | | | |
| CLUT_Y_CR_CB_INIT(0x80, 0x80, 0x80), /*3*/ | | | |
| CLUT_Y_CR_CB_INIT(0x80, 0x80, 0x80), /*4*/ | | | |
| CLUT_Y_CR_CB_INIT(0x80, 0x80, 0x80), /*5*/ | | | |
| CLUT_Y_CR_CB_INIT(0x80, 0x80, 0x80), /*6*/ | | | |
| CLUT_Y_CR_CB_INIT(0xa0, 0x80, 0x80), /*7*/ | | | |
| CLUT_Y_CR_CB_INIT(0xc0, 0x80, 0x80), /*8*/ | | | |
| CLUT_Y_CR_CB_INIT(0xe0, 0x80, 0x80), /*9*/ | | | |
| CLUT_Y_CR_CB_INIT(0xff, 0x80, 0x80), /*10*/ | | | |
| }, | | | |
| /* yellow, black border, transparent */ | | | |
| { | | | |
| CLUT_Y_CR_CB_INIT(0x00, 0x00, 0x00), /*0*/ | | | |
| CLUT_Y_CR_CB_INIT(0x00, 0x80, 0x80), /*1*/ | | | |
| CLUT_Y_CR_CB_INIT(0x00, 0x80, 0x80), /*2*/ | | | |
| CLUT_Y_CR_CB_INIT(0x00, 0x80, 0x80), /*3*/ | | | |
| CLUT_Y_CR_CB_INIT(0x00, 0x80, 0x80), /*4*/ | | | |
| CLUT_Y_CR_CB_INIT(0x00, 0x80, 0x80), /*5*/ | | | |
| CLUT_Y_CR_CB_INIT(0x00, 0x80, 0x80), /*6*/ | | | |
| CLUT_Y_CR_CB_INIT(0x40, 0x84, 0x60), /*7*/ | | | |
| CLUT_Y_CR_CB_INIT(0x70, 0x88, 0x40), /*8*/ | | | |
| CLUT_Y_CR_CB_INIT(0xb0, 0x8a, 0x20), /*9*/ | | | |
| CLUT_Y_CR_CB_INIT(0xff, 0x90, 0x00), /*10*/ | | | |
| }, | | | |
| }; | | | |
| | | | |
| static const uint8_t textpalettes_trans[NUMBER_OF_TEXT_PALETTES][TEXT_PALET | | | |
| TE_SIZE] = { | | | |
| {0, 0, 3, 6, 8, 10, 12, 14, 15, 15, 15 }, | | | |
| {0, 0, 0, 0, 0, 0, 2, 6, 9, 12, 15 }, | | | |
| {0, 8, 9, 10, 11, 12, 13, 14, 15, 15, 15 }, | | | |
| {0, 0, 3, 6, 8, 10, 12, 14, 15, 15, 15 }, | | | |
| }; | | | |
| | | | |
| #endif /* __OSD_C__ */ | | | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 9 change blocks. |
| 112 lines changed or deleted | | 50 lines changed or added | |
|
| post.h | | post.h | |
| | | | |
| skipping to change at line 26 | | skipping to change at line 26 | |
| * You should have received a copy of the GNU General Public License | | * You should have received a copy of the GNU General Public License | |
| * along with this program; if not, write to the Free Software | | * along with this program; if not, write to the Free Software | |
| * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA | | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA | |
| * | | * | |
| * post plugin definitions | | * post plugin definitions | |
| */ | | */ | |
| | | | |
| #ifndef XINE_POST_H | | #ifndef XINE_POST_H | |
| #define XINE_POST_H | | #define XINE_POST_H | |
| | | | |
|
| | | #include <xine.h> | |
| | | #include <xine/video_out.h> | |
| | | #include <xine/audio_out.h> | |
| | | #include <xine/xine_internal.h> | |
| | | #include <xine/xineutils.h> | |
| | | | |
| #ifdef XINE_COMPILE | | #ifdef XINE_COMPILE | |
|
| # include "xine.h" | | # include <xine/plugin_catalog.h> | |
| # include "video_out.h" | | | |
| # include "audio_out.h" | | | |
| # include "xine_internal.h" | | | |
| # include "xineutils.h" | | | |
| #else | | | |
| # include <xine.h> | | | |
| # include <xine/video_out.h> | | | |
| # include <xine/audio_out.h> | | | |
| # include <xine/xine_internal.h> | | | |
| # include <xine/xineutils.h> | | | |
| #endif | | #endif | |
| | | | |
|
| #define POST_PLUGIN_IFACE_VERSION 9 | | #define POST_PLUGIN_IFACE_VERSION 10 | |
| | | | |
| typedef struct post_class_s post_class_t; | | typedef struct post_class_s post_class_t; | |
| typedef struct post_plugin_s post_plugin_t; | | typedef struct post_plugin_s post_plugin_t; | |
| typedef struct post_in_s post_in_t; | | typedef struct post_in_s post_in_t; | |
| typedef struct post_out_s post_out_t; | | typedef struct post_out_s post_out_t; | |
| | | | |
| struct post_class_s { | | struct post_class_s { | |
| | | | |
| /* | | /* | |
| * open a new instance of this plugin class | | * open a new instance of this plugin class | |
| */ | | */ | |
| post_plugin_t* (*open_plugin) (post_class_t *this, int inputs, | | post_plugin_t* (*open_plugin) (post_class_t *this, int inputs, | |
| xine_audio_port_t **audio_target, | | xine_audio_port_t **audio_target, | |
| xine_video_port_t **video_target); | | xine_video_port_t **video_target); | |
| | | | |
|
| /* | | /** | |
| * return short, human readable identifier for this plugin class | | * @brief short human readable identifier for this plugin class | |
| */ | | */ | |
|
| char* (*get_identifier) (post_class_t *this); | | const char *identifier; | |
| | | | |
|
| /* | | /** | |
| * return human readable (verbose = 1 line) description for | | * @brief human readable (verbose = 1 line) description for this plugin c | |
| * this plugin class | | lass | |
| | | * | |
| | | * The description is passed to gettext() to internationalise. | |
| */ | | */ | |
|
| char* (*get_description) (post_class_t *this); | | const char *description; | |
| | | | |
| | | /** | |
| | | * @brief Optional non-standard catalog to use with dgettext() for descri | |
| | | ption. | |
| | | */ | |
| | | const char *text_domain; | |
| | | | |
| /* | | /* | |
| * free all class-related resources | | * free all class-related resources | |
| */ | | */ | |
| | | | |
| void (*dispose) (post_class_t *this); | | void (*dispose) (post_class_t *this); | |
| }; | | }; | |
| | | | |
|
| | | #define default_post_class_dispose (void (*) (post_class_t *this))free | |
| | | | |
| struct post_plugin_s { | | struct post_plugin_s { | |
| | | | |
| /* public part of the plugin */ | | /* public part of the plugin */ | |
| xine_post_t xine_post; | | xine_post_t xine_post; | |
| | | | |
| /* | | /* | |
| * the connections announced by the plugin | | * the connections announced by the plugin | |
| * the plugin must fill these with xine_post_{in,out}_t on init | | * the plugin must fill these with xine_post_{in,out}_t on init | |
| */ | | */ | |
| xine_list_t *input; | | xine_list_t *input; | |
| xine_list_t *output; | | xine_list_t *output; | |
| | | | |
| /* | | /* | |
| * close down, free all resources | | * close down, free all resources | |
| */ | | */ | |
| void (*dispose) (post_plugin_t *this); | | void (*dispose) (post_plugin_t *this); | |
| | | | |
|
| /* has dispose been called */ | | | |
| int dispose_pending; | | | |
| | | | |
| /* plugins don't have to init the stuff below */ | | /* plugins don't have to init the stuff below */ | |
| | | | |
| /* | | /* | |
| * the running ticket | | * the running ticket | |
| * | | * | |
| * the plugin must assure to check for ticket revocation in | | * the plugin must assure to check for ticket revocation in | |
| * intervals of finite length; this means that you must release | | * intervals of finite length; this means that you must release | |
| * the ticket before any operation that might block; | | * the ticket before any operation that might block; | |
| * note that all port functions are safe in this respect | | * note that all port functions are safe in this respect | |
| * | | * | |
| | | | |
| skipping to change at line 116 | | skipping to change at line 117 | |
| xine_ticket_t *running_ticket; | | xine_ticket_t *running_ticket; | |
| | | | |
| /* this is needed by the engine to decrement the reference counter | | /* this is needed by the engine to decrement the reference counter | |
| * on disposal of the plugin, but since this is useful, we expose it */ | | * on disposal of the plugin, but since this is useful, we expose it */ | |
| xine_t *xine; | | xine_t *xine; | |
| | | | |
| /* used when the user requests a list of all inputs/outputs */ | | /* used when the user requests a list of all inputs/outputs */ | |
| const char **input_ids; | | const char **input_ids; | |
| const char **output_ids; | | const char **output_ids; | |
| | | | |
|
| /* used by plugin loader */ | | /** | |
| void *node; | | * @brief Pointer to the loaded plugin node. | |
| | | * | |
| | | * Used by the plugins loader. It's an opaque type when using the | |
| | | * structure outside of xine's build. | |
| | | */ | |
| | | #ifdef XINE_COMPILE | |
| | | plugin_node_t *node; | |
| | | #else | |
| | | void *node; | |
| | | #endif | |
| | | | |
| | | /* has dispose been called */ | |
| | | int dispose_pending; | |
| }; | | }; | |
| | | | |
| /* helper function to initialize a post_plugin_t */ | | /* helper function to initialize a post_plugin_t */ | |
| void _x_post_init(post_plugin_t *post, int num_audio_inputs, int num_video_
inputs) XINE_PROTECTED; | | void _x_post_init(post_plugin_t *post, int num_audio_inputs, int num_video_
inputs) XINE_PROTECTED; | |
| | | | |
| struct post_in_s { | | struct post_in_s { | |
| | | | |
| /* public part of the input */ | | /* public part of the input */ | |
| xine_post_in_t xine_in; | | xine_post_in_t xine_in; | |
| | | | |
| | | | |
| skipping to change at line 177 | | skipping to change at line 190 | |
| | | | |
| /* if you want to decide yourself, whether a given frame should | | /* if you want to decide yourself, whether a given frame should | |
| * be intercepted, fill in this function; get_frame() acts as | | * be intercepted, fill in this function; get_frame() acts as | |
| * a template method and asks your function; return a boolean; | | * a template method and asks your function; return a boolean; | |
| * the default is to intercept all frames */ | | * the default is to intercept all frames */ | |
| int (*intercept_frame)(post_video_port_t *self, vo_frame_t *frame); | | int (*intercept_frame)(post_video_port_t *self, vo_frame_t *frame); | |
| | | | |
| /* the new frame function pointers */ | | /* the new frame function pointers */ | |
| vo_frame_t *new_frame; | | vo_frame_t *new_frame; | |
| | | | |
|
| | | /* if you want to decide yourself, whether the preprocessing functions | |
| | | * should still be routed when draw is intercepted, fill in this | |
| | | * function; _x_post_intercept_video_frame() acts as a template method | |
| | | * and asks your function; return a boolean; the default is _not_ to | |
| | | * route preprocessing functions when draw is intercepted */ | |
| | | int (*route_preprocessing_procs)(post_video_port_t *self, vo_frame_t *fra | |
| | | me); | |
| | | | |
| /* if you want to decide yourself, whether the overlay manager should | | /* if you want to decide yourself, whether the overlay manager should | |
| * be intercepted, fill in this function; get_overlay_manager() acts as | | * be intercepted, fill in this function; get_overlay_manager() acts as | |
| * a template method and asks your function; return a boolean; | | * a template method and asks your function; return a boolean; | |
| * the default is _not_ to intercept the overlay manager */ | | * the default is _not_ to intercept the overlay manager */ | |
| int (*intercept_ovl)(post_video_port_t *self); | | int (*intercept_ovl)(post_video_port_t *self); | |
| | | | |
| /* the new public overlay manager with replaced function pointers */ | | /* the new public overlay manager with replaced function pointers */ | |
| video_overlay_manager_t *new_manager; | | video_overlay_manager_t *new_manager; | |
| | | | |
| /* the original manager to call its functions from inside yours */ | | /* the original manager to call its functions from inside yours */ | |
| | | | |
| skipping to change at line 286 | | skipping to change at line 306 | |
| /* helper structure for intercepting audio port calls */ | | /* helper structure for intercepting audio port calls */ | |
| typedef struct post_audio_port_s post_audio_port_t; | | typedef struct post_audio_port_s post_audio_port_t; | |
| struct post_audio_port_s { | | struct post_audio_port_s { | |
| | | | |
| /* the new public port with replaced function pointers */ | | /* the new public port with replaced function pointers */ | |
| xine_audio_port_t new_port; | | xine_audio_port_t new_port; | |
| | | | |
| /* the original port to call its functions from inside yours */ | | /* the original port to call its functions from inside yours */ | |
| xine_audio_port_t *original_port; | | xine_audio_port_t *original_port; | |
| | | | |
|
| /* usage counter: how many objects are floating around that need | | | |
| * these pointers to exist */ | | | |
| int usage_count; | | | |
| pthread_mutex_t usage_lock; | | | |
| | | | |
| /* the stream we are being fed by; NULL means no stream is connected; | | /* the stream we are being fed by; NULL means no stream is connected; | |
| * this may be an anonymous stream */ | | * this may be an anonymous stream */ | |
| xine_stream_t *stream; | | xine_stream_t *stream; | |
| | | | |
|
| /* some values remembered by port->open() */ | | pthread_mutex_t usage_lock; | |
| | | /* usage counter: how many objects are floating around that need | |
| | | * these pointers to exist */ | |
| | | int usage_count; | |
| | | | |
| | | /* some values remembered by (port->open) () */ | |
| uint32_t bits; | | uint32_t bits; | |
| uint32_t rate; | | uint32_t rate; | |
| uint32_t mode; | | uint32_t mode; | |
| | | | |
| /* point to a mutex here, if you need some synchronization */ | | /* point to a mutex here, if you need some synchronization */ | |
| pthread_mutex_t *port_lock; | | pthread_mutex_t *port_lock; | |
| | | | |
| /* backward reference so that you have access to the post plugin | | /* backward reference so that you have access to the post plugin | |
| * when the call only gives you the port */ | | * when the call only gives you the port */ | |
| post_plugin_t *post; | | post_plugin_t *post; | |
| | | | |
End of changes. 13 change blocks. |
| 30 lines changed or deleted | | 53 lines changed or added | |
|
| video_out.h | | video_out.h | |
| | | | |
| skipping to change at line 41 | | skipping to change at line 41 | |
| | | | |
| #ifndef HAVE_VIDEO_OUT_H | | #ifndef HAVE_VIDEO_OUT_H | |
| #define HAVE_VIDEO_OUT_H | | #define HAVE_VIDEO_OUT_H | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| extern "C" { | | extern "C" { | |
| #endif | | #endif | |
| | | | |
| #include <pthread.h> | | #include <pthread.h> | |
| | | | |
|
| | | #include <xine.h> | |
| | | #include <xine/buffer.h> | |
| | | | |
| #ifdef XINE_COMPILE | | #ifdef XINE_COMPILE | |
|
| # include "xine.h" | | # include <xine/plugin_catalog.h> | |
| # include "buffer.h" | | | |
| #else | | | |
| # include <xine.h> | | | |
| # include <xine/buffer.h> | | | |
| #endif | | #endif | |
| | | | |
| typedef struct vo_frame_s vo_frame_t; | | typedef struct vo_frame_s vo_frame_t; | |
| typedef struct vo_driver_s vo_driver_t; | | typedef struct vo_driver_s vo_driver_t; | |
| typedef struct video_driver_class_s video_driver_class_t; | | typedef struct video_driver_class_s video_driver_class_t; | |
| typedef struct vo_overlay_s vo_overlay_t; | | typedef struct vo_overlay_s vo_overlay_t; | |
| typedef struct video_overlay_manager_s video_overlay_manager_t; | | typedef struct video_overlay_manager_s video_overlay_manager_t; | |
| | | | |
| /* public part, video drivers may add private fields | | /* public part, video drivers may add private fields | |
| * | | * | |
| * Remember that adding new functions to this structure requires | | * Remember that adding new functions to this structure requires | |
| * adaption of the post plugin decoration layer. Be sure to look into | | * adaption of the post plugin decoration layer. Be sure to look into | |
| * src/xine-engine/post.[ch]. | | * src/xine-engine/post.[ch]. | |
| */ | | */ | |
| struct vo_frame_s { | | struct vo_frame_s { | |
| /* | | /* | |
| * member functions | | * member functions | |
| */ | | */ | |
| | | | |
|
| | | /* Provide a copy of the frame's image in an image format already known t | |
| | | o xine. data's member */ | |
| | | /* have already been intialized to frame's content on entry, so it's usua | |
| | | lly only necessary to */ | |
| | | /* change format and img_size. In case img is set, it will point to a mem | |
| | | ory block of suitable */ | |
| | | /* size (size has been determined by a previous call with img == NULL). i | |
| | | mg content and img_size */ | |
| | | /* must adhere to the specification of _x_get_current_frame_data(). */ | |
| | | /* Currently this is needed for all image formats except XINE_IMGFMT_YV12 | |
| | | and XINE_IMGFMT_YUY2. */ | |
| | | void (*proc_provide_standard_frame_data) (vo_frame_t *vo_img, xine_curren | |
| | | t_frame_data_t *data); | |
| | | | |
| /* Duplicate picture data and acceleration specific data of a frame. */ | | /* Duplicate picture data and acceleration specific data of a frame. */ | |
| /* if the image format isn't already known by Xine. Currently this is nee
ded */ | | /* if the image format isn't already known by Xine. Currently this is nee
ded */ | |
| /* For all image formats except XINE_IMGFMT_YV12 and XINE_IMGFMT_YUY2 */ | | /* For all image formats except XINE_IMGFMT_YV12 and XINE_IMGFMT_YUY2 */ | |
| void (*proc_duplicate_frame_data) (vo_frame_t *vo_img, vo_frame_t *src); | | void (*proc_duplicate_frame_data) (vo_frame_t *vo_img, vo_frame_t *src); | |
| | | | |
| /* tell video driver to copy/convert the whole of this frame, may be NULL
*/ | | /* tell video driver to copy/convert the whole of this frame, may be NULL
*/ | |
| /* at least one of proc_frame() and proc_slice() MUST set the variable pr
oc_called to 1 */ | | /* at least one of proc_frame() and proc_slice() MUST set the variable pr
oc_called to 1 */ | |
| void (*proc_frame) (vo_frame_t *vo_img); | | void (*proc_frame) (vo_frame_t *vo_img); | |
| | | | |
| /* tell video driver to copy/convert a slice of this frame, may be NULL *
/ | | /* tell video driver to copy/convert a slice of this frame, may be NULL *
/ | |
| | | | |
| skipping to change at line 125 | | skipping to change at line 132 | |
| int repeat_first_field; | | int repeat_first_field; | |
| /* note: progressive_frame is set wrong on many mpeg2 streams. for | | /* note: progressive_frame is set wrong on many mpeg2 streams. for | |
| * that reason, this flag should be interpreted as a "hint". | | * that reason, this flag should be interpreted as a "hint". | |
| */ | | */ | |
| int progressive_frame; | | int progressive_frame; | |
| int picture_coding_type; | | int picture_coding_type; | |
| | | | |
| /* cropping to be done */ | | /* cropping to be done */ | |
| int crop_left, crop_right, crop_top, crop_bottom; | | int crop_left, crop_right, crop_top, crop_bottom; | |
| | | | |
|
| | | int lock_counter; | |
| | | pthread_mutex_t mutex; /* protect access to lock_count */ | |
| | | | |
| /* extra info coming from input or demuxers */ | | /* extra info coming from input or demuxers */ | |
| extra_info_t *extra_info; | | extra_info_t *extra_info; | |
| | | | |
| /* additional information to be able to duplicate frames: */ | | /* additional information to be able to duplicate frames: */ | |
| int width, height; | | int width, height; | |
| double ratio; /* aspect ratio */ | | double ratio; /* aspect ratio */ | |
| int format; /* IMGFMT_YV12 or IMGFMT_YUY2
*/ | | int format; /* IMGFMT_YV12 or IMGFMT_YUY2
*/ | |
| | | | |
| int drawn; /* used by decoder, frame has a
lready been drawn */ | | int drawn; /* used by decoder, frame has a
lready been drawn */ | |
| int flags; /* remember the frame flags */ | | int flags; /* remember the frame flags */ | |
| | | | |
| skipping to change at line 148 | | skipping to change at line 158 | |
| void *accel_data; | | void *accel_data; | |
| | | | |
| /* "backward" references to where this frame originates from */ | | /* "backward" references to where this frame originates from */ | |
| xine_video_port_t *port; | | xine_video_port_t *port; | |
| vo_driver_t *driver; | | vo_driver_t *driver; | |
| xine_stream_t *stream; | | xine_stream_t *stream; | |
| | | | |
| /* displacement for overlays */ | | /* displacement for overlays */ | |
| int overlay_offset_x, overlay_offset_y; | | int overlay_offset_x, overlay_offset_y; | |
| | | | |
|
| | | /* pointer to the next frame in display order, used by some vo deint */ | |
| | | struct vo_frame_s *future_frame; | |
| | | | |
| /* | | /* | |
| * that part is used only by video_out.c for frame management | | * that part is used only by video_out.c for frame management | |
| * obs: changing anything here will require recompiling vo drivers | | * obs: changing anything here will require recompiling vo drivers | |
| */ | | */ | |
| struct vo_frame_s *next; | | struct vo_frame_s *next; | |
|
| int lock_counter; | | | |
| pthread_mutex_t mutex; /* protect access to lock_count */ | | | |
| | | | |
| int id; /* debugging - track this frame */ | | int id; /* debugging - track this frame */ | |
| int is_first; | | int is_first; | |
| }; | | }; | |
| | | | |
| /* | | /* | |
| * Remember that adding new functions to this structure requires | | * Remember that adding new functions to this structure requires | |
| * adaption of the post plugin decoration layer. Be sure to look into | | * adaption of the post plugin decoration layer. Be sure to look into | |
| * src/xine-engine/post.[ch]. | | * src/xine-engine/post.[ch]. | |
| */ | | */ | |
| | | | |
| skipping to change at line 187 | | skipping to change at line 198 | |
| * params : width == width of video to display. | | * params : width == width of video to display. | |
| * height == height of video to display. | | * height == height of video to display. | |
| * ratio == aspect ration information | | * ratio == aspect ration information | |
| * format == FOURCC descriptor of image format | | * format == FOURCC descriptor of image format | |
| * flags == field/prediction flags | | * flags == field/prediction flags | |
| */ | | */ | |
| vo_frame_t* (*get_frame) (xine_video_port_t *self, uint32_t width, | | vo_frame_t* (*get_frame) (xine_video_port_t *self, uint32_t width, | |
| uint32_t height, double ratio, | | uint32_t height, double ratio, | |
| int format, int flags); | | int format, int flags); | |
| | | | |
|
| | | /* create a new grab video frame */ | |
| | | xine_grab_video_frame_t* (*new_grab_video_frame) (xine_video_port_t *self | |
| | | ); | |
| | | | |
| /* retrieves the last displayed frame (useful for taking snapshots) */ | | /* retrieves the last displayed frame (useful for taking snapshots) */ | |
| vo_frame_t* (*get_last_frame) (xine_video_port_t *self); | | vo_frame_t* (*get_last_frame) (xine_video_port_t *self); | |
| | | | |
| /* overlay stuff */ | | /* overlay stuff */ | |
| void (*enable_ovl) (xine_video_port_t *self, int ovl_enable); | | void (*enable_ovl) (xine_video_port_t *self, int ovl_enable); | |
| | | | |
| /* get overlay manager */ | | /* get overlay manager */ | |
| video_overlay_manager_t* (*get_overlay_manager) (xine_video_port_t *self)
; | | video_overlay_manager_t* (*get_overlay_manager) (xine_video_port_t *self)
; | |
| | | | |
| /* flush video_out fifo */ | | /* flush video_out fifo */ | |
| void (*flush) (xine_video_port_t *self); | | void (*flush) (xine_video_port_t *self); | |
| | | | |
|
| | | /* trigger immediate drawing */ | |
| | | void (*trigger_drawing) (xine_video_port_t *self); | |
| | | | |
| /* Get/Set video property | | /* Get/Set video property | |
| * | | * | |
| * See VO_PROP_* bellow | | * See VO_PROP_* bellow | |
| */ | | */ | |
| int (*get_property) (xine_video_port_t *self, int property); | | int (*get_property) (xine_video_port_t *self, int property); | |
| int (*set_property) (xine_video_port_t *self, int property, int value); | | int (*set_property) (xine_video_port_t *self, int property, int value); | |
| | | | |
| /* return true if port is opened for this stream, stream can be anonymous
*/ | | /* return true if port is opened for this stream, stream can be anonymous
*/ | |
| int (*status) (xine_video_port_t *self, xine_stream_t *stream, | | int (*status) (xine_video_port_t *self, xine_stream_t *stream, | |
| int *width, int *height, int64_t *img_duration); | | int *width, int *height, int64_t *img_duration); | |
| | | | |
| skipping to change at line 247 | | skipping to change at line 264 | |
| #define VO_PROP_ZOOM_Y 13 | | #define VO_PROP_ZOOM_Y 13 | |
| #define VO_PROP_DISCARD_FRAMES 14 /* not used by drivers */ | | #define VO_PROP_DISCARD_FRAMES 14 /* not used by drivers */ | |
| #define VO_PROP_WINDOW_WIDTH 15 /* read-only */ | | #define VO_PROP_WINDOW_WIDTH 15 /* read-only */ | |
| #define VO_PROP_WINDOW_HEIGHT 16 /* read-only */ | | #define VO_PROP_WINDOW_HEIGHT 16 /* read-only */ | |
| #define VO_PROP_BUFS_IN_FIFO 17 /* read-only */ | | #define VO_PROP_BUFS_IN_FIFO 17 /* read-only */ | |
| #define VO_PROP_NUM_STREAMS 18 /* read-only */ | | #define VO_PROP_NUM_STREAMS 18 /* read-only */ | |
| #define VO_PROP_OUTPUT_WIDTH 19 /* read-only */ | | #define VO_PROP_OUTPUT_WIDTH 19 /* read-only */ | |
| #define VO_PROP_OUTPUT_HEIGHT 20 /* read-only */ | | #define VO_PROP_OUTPUT_HEIGHT 20 /* read-only */ | |
| #define VO_PROP_OUTPUT_XOFFSET 21 /* read-only */ | | #define VO_PROP_OUTPUT_XOFFSET 21 /* read-only */ | |
| #define VO_PROP_OUTPUT_YOFFSET 22 /* read-only */ | | #define VO_PROP_OUTPUT_YOFFSET 22 /* read-only */ | |
|
| #define VO_NUM_PROPERTIES 23 | | #define VO_PROP_SHARPNESS 24 | |
| | | #define VO_PROP_NOISE_REDUCTION 25 | |
| | | #define VO_PROP_BUFS_TOTAL 26 /* read-only */ | |
| | | #define VO_PROP_BUFS_FREE 27 /* read-only */ | |
| | | #define VO_NUM_PROPERTIES 28 | |
| | | | |
| /* number of colors in the overlay palette. Currently limited to 256 | | /* number of colors in the overlay palette. Currently limited to 256 | |
| at most, because some alphablend functions use an 8-bit index into | | at most, because some alphablend functions use an 8-bit index into | |
| the palette. This should probably be classified as a bug. */ | | the palette. This should probably be classified as a bug. */ | |
| #define OVL_PALETTE_SIZE 256 | | #define OVL_PALETTE_SIZE 256 | |
| | | | |
| #define OVL_MAX_OPACITY 0x0f | | #define OVL_MAX_OPACITY 0x0f | |
| | | | |
| /* number of recent frames to keep in memory | | /* number of recent frames to keep in memory | |
| these frames are needed by some deinterlace algorithms | | these frames are needed by some deinterlace algorithms | |
| | | | |
| skipping to change at line 269 | | skipping to change at line 290 | |
| */ | | */ | |
| #define VO_NUM_RECENT_FRAMES 2 | | #define VO_NUM_RECENT_FRAMES 2 | |
| | | | |
| /* get_frame flags */ | | /* get_frame flags */ | |
| #define VO_TOP_FIELD 1 | | #define VO_TOP_FIELD 1 | |
| #define VO_BOTTOM_FIELD 2 | | #define VO_BOTTOM_FIELD 2 | |
| #define VO_BOTH_FIELDS (VO_TOP_FIELD | VO_BOTTOM_FIELD) | | #define VO_BOTH_FIELDS (VO_TOP_FIELD | VO_BOTTOM_FIELD) | |
| #define VO_PAN_SCAN_FLAG 4 | | #define VO_PAN_SCAN_FLAG 4 | |
| #define VO_INTERLACED_FLAG 8 | | #define VO_INTERLACED_FLAG 8 | |
| #define VO_NEW_SEQUENCE_FLAG 16 /* set after MPEG2 Sequence Header Code (us
ed by XvMC) */ | | #define VO_NEW_SEQUENCE_FLAG 16 /* set after MPEG2 Sequence Header Code (us
ed by XvMC) */ | |
|
| | | #define VO_CHROMA_422 32 /* used by VDPAU, default is chroma_420 */ | |
| | | #define VO_STILL_IMAGE 64 | |
| | | | |
| /* video driver capabilities */ | | /* video driver capabilities */ | |
| #define VO_CAP_YV12 0x00000001 /* driver can handle YUV 4
:2:0 pictures */ | | #define VO_CAP_YV12 0x00000001 /* driver can handle YUV 4
:2:0 pictures */ | |
| #define VO_CAP_YUY2 0x00000002 /* driver can handle YUY2
pictures */ | | #define VO_CAP_YUY2 0x00000002 /* driver can handle YUY2
pictures */ | |
| #define VO_CAP_XVMC_MOCOMP 0x00000004 /* driver can use XvMC mot
ion compensation */ | | #define VO_CAP_XVMC_MOCOMP 0x00000004 /* driver can use XvMC mot
ion compensation */ | |
| #define VO_CAP_XVMC_IDCT 0x00000008 /* driver can use XvMC idc
t acceleration */ | | #define VO_CAP_XVMC_IDCT 0x00000008 /* driver can use XvMC idc
t acceleration */ | |
| #define VO_CAP_UNSCALED_OVERLAY 0x00000010 /* driver can blend overla
y at output resolution */ | | #define VO_CAP_UNSCALED_OVERLAY 0x00000010 /* driver can blend overla
y at output resolution */ | |
| #define VO_CAP_CROP 0x00000020 /* driver can crop */ | | #define VO_CAP_CROP 0x00000020 /* driver can crop */ | |
| #define VO_CAP_XXMC 0x00000040 /* driver can use extended
XvMC */ | | #define VO_CAP_XXMC 0x00000040 /* driver can use extended
XvMC */ | |
|
| | | #define VO_CAP_VDPAU_H264 0x00000080 /* driver can use VDPAU fo | |
| | | r H264 */ | |
| | | #define VO_CAP_VDPAU_MPEG12 0x00000100 /* driver can use VDPAU fo | |
| | | r mpeg1/2 */ | |
| | | #define VO_CAP_VDPAU_VC1 0x00000200 /* driver can use VDPAU fo | |
| | | r VC1 */ | |
| | | #define VO_CAP_VDPAU_MPEG4 0x00000400 /* driver can use VDPAU fo | |
| | | r mpeg4-part2 */ | |
| | | #define VO_CAP_HUE 0x00010000 | |
| | | #define VO_CAP_SATURATION 0x00020000 | |
| | | #define VO_CAP_CONTRAST 0x00040000 | |
| | | #define VO_CAP_BRIGHTNESS 0x00080000 | |
| | | #define VO_CAP_COLORKEY 0x00100000 | |
| | | #define VO_CAP_AUTOPAINT_COLORKEY 0x00200000 | |
| | | #define VO_CAP_ZOOM_X 0x00400000 | |
| | | #define VO_CAP_ZOOM_Y 0x00800000 | |
| | | #define VO_CAP_CUSTOM_EXTENT_OVERLAY 0x01000000 /* driver can blend custom | |
| | | extent overlay to output extent */ | |
| | | #define VO_CAP_ARGB_LAYER_OVERLAY 0x02000000 /* driver supports true co | |
| | | lor overlay */ | |
| | | #define VO_CAP_VIDEO_WINDOW_OVERLAY 0x04000000 /* driver can scale video | |
| | | to an area within overlay */ | |
| | | #define VO_CAP_GAMMA 0x08000000 | |
| | | #define VO_CAP_SHARPNESS 0x10000000 | |
| | | #define VO_CAP_NOISE_REDUCTION 0x20000000 | |
| | | | |
| /* | | /* | |
| * vo_driver_s contains the functions every display driver | | * vo_driver_s contains the functions every display driver | |
| * has to implement. The vo_new_port function (see below) | | * has to implement. The vo_new_port function (see below) | |
| * should then be used to construct a vo_port using this | | * should then be used to construct a vo_port using this | |
| * driver. Some of the function pointers will be copied | | * driver. Some of the function pointers will be copied | |
| * directly into xine_video_port_s, others will be called | | * directly into xine_video_port_s, others will be called | |
| * from generic vo functions. | | * from generic vo functions. | |
| */ | | */ | |
| | | | |
|
| #define VIDEO_OUT_DRIVER_IFACE_VERSION 21 | | #define VIDEO_OUT_DRIVER_IFACE_VERSION 22 | |
| | | | |
| struct vo_driver_s { | | struct vo_driver_s { | |
| | | | |
| uint32_t (*get_capabilities) (vo_driver_t *self); /* for constants see ab
ove */ | | uint32_t (*get_capabilities) (vo_driver_t *self); /* for constants see ab
ove */ | |
| | | | |
| /* | | /* | |
| * allocate an vo_frame_t struct, | | * allocate an vo_frame_t struct, | |
| * the driver must supply the copy, field and dispose functions | | * the driver must supply the copy, field and dispose functions | |
| */ | | */ | |
| vo_frame_t* (*alloc_frame) (vo_driver_t *self); | | vo_frame_t* (*alloc_frame) (vo_driver_t *self); | |
| | | | |
| skipping to change at line 351 | | skipping to change at line 392 | |
| */ | | */ | |
| int (*gui_data_exchange) (vo_driver_t *self, int data_type, | | int (*gui_data_exchange) (vo_driver_t *self, int data_type, | |
| void *data); | | void *data); | |
| | | | |
| /* check if a redraw is needed (due to resize) | | /* check if a redraw is needed (due to resize) | |
| * this is only used for still frames, normal video playback | | * this is only used for still frames, normal video playback | |
| * must call that inside display_frame() function. | | * must call that inside display_frame() function. | |
| */ | | */ | |
| int (*redraw_needed) (vo_driver_t *self); | | int (*redraw_needed) (vo_driver_t *self); | |
| | | | |
|
| | | /* Create a new grab video frame */ | |
| | | xine_grab_video_frame_t* (*new_grab_video_frame)(vo_driver_t *self); | |
| | | | |
| /* | | /* | |
| * free all resources, close driver | | * free all resources, close driver | |
| */ | | */ | |
| void (*dispose) (vo_driver_t *self); | | void (*dispose) (vo_driver_t *self); | |
| | | | |
|
| void *node; /* needed by plugin_loader */ | | /** | |
| | | * @brief Pointer to the loaded plugin node. | |
| | | * | |
| | | * Used by the plugins loader. It's an opaque type when using the | |
| | | * structure outside of xine's build. | |
| | | */ | |
| | | #ifdef XINE_COMPILE | |
| | | plugin_node_t *node; | |
| | | #else | |
| | | void *node; | |
| | | #endif | |
| }; | | }; | |
| | | | |
| struct video_driver_class_s { | | struct video_driver_class_s { | |
| | | | |
| /* | | /* | |
| * open a new instance of this plugin class | | * open a new instance of this plugin class | |
| */ | | */ | |
| vo_driver_t* (*open_plugin) (video_driver_class_t *self, const void *visu
al); | | vo_driver_t* (*open_plugin) (video_driver_class_t *self, const void *visu
al); | |
| | | | |
|
| /* | | /** | |
| * return short, human readable identifier for this plugin class | | * @brief short human readable identifier for this plugin class | |
| */ | | */ | |
|
| char* (*get_identifier) (video_driver_class_t *self); | | const char *identifier; | |
| | | | |
|
| /* | | /** | |
| * return human readable (verbose = 1 line) description for | | * @brief human readable (verbose = 1 line) description for this plugin c | |
| * this plugin class | | lass | |
| | | * | |
| | | * The description is passed to gettext() to internationalise. | |
| */ | | */ | |
|
| char* (*get_description) (video_driver_class_t *self); | | const char *description; | |
| | | | |
| | | /** | |
| | | * @brief Optional non-standard catalog to use with dgettext() for descri | |
| | | ption. | |
| | | */ | |
| | | const char *text_domain; | |
| | | | |
| /* | | /* | |
| * free all class-related resources | | * free all class-related resources | |
| */ | | */ | |
| void (*dispose) (video_driver_class_t *self); | | void (*dispose) (video_driver_class_t *self); | |
| }; | | }; | |
| | | | |
|
| | | #define default_video_driver_class_dispose (void (*) (video_driver_class_t | |
| | | *this))free | |
| | | | |
| typedef struct rle_elem_s { | | typedef struct rle_elem_s { | |
| uint16_t len; | | uint16_t len; | |
| uint16_t color; | | uint16_t color; | |
| } rle_elem_t; | | } rle_elem_t; | |
| | | | |
|
| | | typedef struct argb_layer_s { | |
| | | pthread_mutex_t mutex; | |
| | | uint32_t *buffer; | |
| | | /* dirty area */ | |
| | | int x1, y1; | |
| | | int x2, y2; | |
| | | int ref_count; | |
| | | } argb_layer_t; | |
| | | | |
| struct vo_overlay_s { | | struct vo_overlay_s { | |
| | | | |
| rle_elem_t *rle; /* rle code buffer */ | | rle_elem_t *rle; /* rle code buffer */ | |
| int data_size; /* useful for deciding realloc */ | | int data_size; /* useful for deciding realloc */ | |
| int num_rle; /* number of active rle codes */ | | int num_rle; /* number of active rle codes */ | |
| int x; /* x start of subpicture area */ | | int x; /* x start of subpicture area */ | |
| int y; /* y start of subpicture area */ | | int y; /* y start of subpicture area */ | |
| int width; /* width of subpicture area */ | | int width; /* width of subpicture area */ | |
| int height; /* height of subpicture area */ | | int height; /* height of subpicture area */ | |
| | | | |
|
| | | /* area within osd extent to scale video to */ | |
| | | int video_window_x; | |
| | | int video_window_y; | |
| | | int video_window_width; | |
| | | int video_window_height; | |
| | | | |
| | | /* extent of reference coordinate system */ | |
| | | int extent_width; | |
| | | int extent_height; | |
| | | | |
| uint32_t color[OVL_PALETTE_SIZE]; /* color lookup table */ | | uint32_t color[OVL_PALETTE_SIZE]; /* color lookup table */ | |
| uint8_t trans[OVL_PALETTE_SIZE]; /* mixer key table */ | | uint8_t trans[OVL_PALETTE_SIZE]; /* mixer key table */ | |
| int rgb_clut; /* true if clut was converted to rgb */ | | int rgb_clut; /* true if clut was converted to rgb */ | |
| | | | |
| /* define a highlight area with different colors */ | | /* define a highlight area with different colors */ | |
| int hili_top; | | int hili_top; | |
| int hili_bottom; | | int hili_bottom; | |
| int hili_left; | | int hili_left; | |
| int hili_right; | | int hili_right; | |
| uint32_t hili_color[OVL_PALETTE_SIZE]; | | uint32_t hili_color[OVL_PALETTE_SIZE]; | |
| uint8_t hili_trans[OVL_PALETTE_SIZE]; | | uint8_t hili_trans[OVL_PALETTE_SIZE]; | |
| int hili_rgb_clut; /* true if clut was converted to rgb */ | | int hili_rgb_clut; /* true if clut was converted to rgb */ | |
| | | | |
| int unscaled; /* true if it should be blended unscaled
*/ | | int unscaled; /* true if it should be blended unscaled
*/ | |
|
| | | | |
| | | argb_layer_t *argb_layer; | |
| }; | | }; | |
| | | | |
|
| | | void set_argb_layer_ptr(argb_layer_t **dst, argb_layer_t *src); | |
| | | | |
| /* API to video_overlay manager | | /* API to video_overlay manager | |
| * | | * | |
| * Remember that adding new functions to this structure requires | | * Remember that adding new functions to this structure requires | |
| * adaption of the post plugin decoration layer. Be sure to look into | | * adaption of the post plugin decoration layer. Be sure to look into | |
| * src/xine-engine/post.[ch]. | | * src/xine-engine/post.[ch]. | |
| */ | | */ | |
| struct video_overlay_manager_s { | | struct video_overlay_manager_s { | |
| void (*init) (video_overlay_manager_t *this_gen); | | void (*init) (video_overlay_manager_t *this_gen); | |
| | | | |
| void (*dispose) (video_overlay_manager_t *this_gen); | | void (*dispose) (video_overlay_manager_t *this_gen); | |
| | | | |
| skipping to change at line 439 | | skipping to change at line 524 | |
| int32_t (*add_event) (video_overlay_manager_t *this_gen, void *event); | | int32_t (*add_event) (video_overlay_manager_t *this_gen, void *event); | |
| | | | |
| void (*flush_events) (video_overlay_manager_t *this_gen ); | | void (*flush_events) (video_overlay_manager_t *this_gen ); | |
| | | | |
| int (*redraw_needed) (video_overlay_manager_t *this_gen, int64_t vpts ); | | int (*redraw_needed) (video_overlay_manager_t *this_gen, int64_t vpts ); | |
| | | | |
| void (*multiple_overlay_blend) (video_overlay_manager_t *this_gen, int64_
t vpts, | | void (*multiple_overlay_blend) (video_overlay_manager_t *this_gen, int64_
t vpts, | |
| vo_driver_t *output, vo_frame_t *vo_img,
int enabled); | | vo_driver_t *output, vo_frame_t *vo_img,
int enabled); | |
| }; | | }; | |
| | | | |
|
| /* | | /** | |
| * build a video_out_port from | | * @brief Build a video output port from a given video driver. | |
| * a given video driver | | * | |
| | | * @internal | |
| */ | | */ | |
|
| xine_video_port_t *_x_vo_new_port (xine_t *xine, vo_driver_t *driver, int g
rabonly) XINE_MALLOC XINE_PROTECTED; | | xine_video_port_t *_x_vo_new_port (xine_t *xine, vo_driver_t *driver, int g
rabonly) XINE_MALLOC; | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| } | | } | |
| #endif | | #endif | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 25 change blocks. |
| 21 lines changed or deleted | | 124 lines changed or added | |
|
| xine.h | | xine.h | |
| | | | |
| skipping to change at line 38 | | skipping to change at line 38 | |
| * (2) as a rule of thumb, never free() or realloc() any pointers | | * (2) as a rule of thumb, never free() or realloc() any pointers | |
| * returned by the xine engine (unless stated otherwise) | | * returned by the xine engine (unless stated otherwise) | |
| * or, in other words: | | * or, in other words: | |
| * do not free() stuff you have not malloc()ed | | * do not free() stuff you have not malloc()ed | |
| * (3) xine is multi-threaded, make sure your programming environment | | * (3) xine is multi-threaded, make sure your programming environment | |
| * can handle this. | | * can handle this. | |
| * for x11-related stuff this means that you either have to properly | | * for x11-related stuff this means that you either have to properly | |
| * use xlockdisplay() or use two seperate connections to the x-server | | * use xlockdisplay() or use two seperate connections to the x-server | |
| * | | * | |
| */ | | */ | |
|
| | | /*_x_ Lines formatted like this one are xine-lib developer comments. */ | |
| | | /*_x_ They will be removed from the installed version of this header. */ | |
| | | | |
| #ifndef HAVE_XINE_H | | #ifndef HAVE_XINE_H | |
| #define HAVE_XINE_H | | #define HAVE_XINE_H | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| extern "C" { | | extern "C" { | |
| #endif | | #endif | |
| | | | |
| #include <sys/types.h> | | #include <sys/types.h> | |
| #include <sys/time.h> | | #include <sys/time.h> | |
| #include <time.h> | | #include <time.h> | |
| #include <stdarg.h> | | #include <stdarg.h> | |
| | | | |
| #ifdef WIN32 | | #ifdef WIN32 | |
| #include <windows.h> | | #include <windows.h> | |
| #include <windowsx.h> | | #include <windowsx.h> | |
| #endif | | #endif | |
| | | | |
|
| #ifdef XINE_COMPILE | | | |
| #include <inttypes.h> | | | |
| #include "attributes.h" | | | |
| #else | | | |
| #include <xine/os_types.h> | | #include <xine/os_types.h> | |
| #include <xine/attributes.h> | | #include <xine/attributes.h> | |
|
| #endif | | #include <xine/version.h> | |
| | | | |
| /* This enables some experimental features. These are not part of the | | /* This enables some experimental features. These are not part of the | |
| * official libxine API, so use them only, if you absolutely need them. | | * official libxine API, so use them only, if you absolutely need them. | |
| * Although we make efforts to keep even this part of the API as stable | | * Although we make efforts to keep even this part of the API as stable | |
| * as possible, this is not guaranteed. Incompatible changes can occur. | | * as possible, this is not guaranteed. Incompatible changes can occur. | |
| */ | | */ | |
| /* #define XINE_ENABLE_EXPERIMENTAL_FEATURES */ | | /* #define XINE_ENABLE_EXPERIMENTAL_FEATURES */ | |
| | | | |
| /* This disables some deprecated features. These are still part of the | | /* This disables some deprecated features. These are still part of the | |
| * official libxine API and you may still use them. During the current | | * official libxine API and you may still use them. During the current | |
| | | | |
| skipping to change at line 87 | | skipping to change at line 85 | |
| | | | |
| /********************************************************************* | | /********************************************************************* | |
| * xine opaque data types * | | * xine opaque data types * | |
| *********************************************************************/ | | *********************************************************************/ | |
| | | | |
| typedef struct xine_s xine_t; | | typedef struct xine_s xine_t; | |
| typedef struct xine_stream_s xine_stream_t; | | typedef struct xine_stream_s xine_stream_t; | |
| typedef struct xine_audio_port_s xine_audio_port_t; | | typedef struct xine_audio_port_s xine_audio_port_t; | |
| typedef struct xine_video_port_s xine_video_port_t; | | typedef struct xine_video_port_s xine_video_port_t; | |
| | | | |
|
| #ifndef XINE_DISABLE_DEPRECATED_FEATURES | | | |
| /* convenience types: simple player UIs might want to call ports drivers */ | | | |
| typedef xine_audio_port_t xine_ao_driver_t XINE_DEPRECATED; | | | |
| typedef xine_video_port_t xine_vo_driver_t XINE_DEPRECATED; | | | |
| #endif | | | |
| | | | |
| /********************************************************************* | | /********************************************************************* | |
| * global engine handling * | | * global engine handling * | |
| *********************************************************************/ | | *********************************************************************/ | |
| | | | |
| /* | | /* | |
| * version information | | * version information | |
| */ | | */ | |
| | | | |
| /* dynamic info from actually linked libxine */ | | /* dynamic info from actually linked libxine */ | |
| const char *xine_get_version_string (void) XINE_PROTECTED; | | const char *xine_get_version_string (void) XINE_PROTECTED; | |
| void xine_get_version (int *major, int *minor, int *sub) XINE_PROTECTED; | | void xine_get_version (int *major, int *minor, int *sub) XINE_PROTECTED; | |
| | | | |
| /* compare given version to libxine version, | | /* compare given version to libxine version, | |
| return 1 if compatible, 0 otherwise */ | | return 1 if compatible, 0 otherwise */ | |
| int xine_check_version (int major, int minor, int sub) XINE_PROTECTED; | | int xine_check_version (int major, int minor, int sub) XINE_PROTECTED; | |
| | | | |
|
| /* static info - which libxine release this header came from */ | | | |
| #define XINE_MAJOR_VERSION 1 | | | |
| #define XINE_MINOR_VERSION 1 | | | |
| #define XINE_SUB_VERSION 20 | | | |
| #define XINE_VERSION "1.1.20.1" | | | |
| | | | |
| /* | | /* | |
| * pre-init the xine engine | | * pre-init the xine engine | |
| * | | * | |
| * will first malloc and init a xine_t, create an empty config | | * will first malloc and init a xine_t, create an empty config | |
| * system, then scan through all installed plugins and add them | | * system, then scan through all installed plugins and add them | |
| * to an internal list for later use. | | * to an internal list for later use. | |
| * | | * | |
| * to fully init the xine engine, you have to load config values | | * to fully init the xine engine, you have to load config values | |
| * (either using your own storage method and calling | | * (either using your own storage method and calling | |
| * xine_config_register_entry, or by using the xine_load_config | | * xine_config_register_entry, or by using the xine_load_config | |
| * utility function - see below) and then call xine_init | | * utility function - see below) and then call xine_init | |
| * | | * | |
| * the only proper way to shut down the xine engine is to | | * the only proper way to shut down the xine engine is to | |
| * call xine_exit() - do not try to free() the xine pointer | | * call xine_exit() - do not try to free() the xine pointer | |
| * yourself and do not try to access any internal data structures | | * yourself and do not try to access any internal data structures | |
| */ | | */ | |
| xine_t *xine_new (void) XINE_PROTECTED; | | xine_t *xine_new (void) XINE_PROTECTED; | |
| | | | |
|
| | | /* allow the setting of some flags before xine_init | |
| | | * FIXME-ABI: this is currently GLOBAL | |
| | | */ | |
| | | void xine_set_flags (xine_t *, int) XINE_PROTECTED __attribute__((weak)); | |
| | | #define XINE_FLAG_NO_WRITE_CACHE 1 | |
| | | | |
| /* | | /* | |
| * post_init the xine engine | | * post_init the xine engine | |
| */ | | */ | |
| void xine_init (xine_t *self) XINE_PROTECTED; | | void xine_init (xine_t *self) XINE_PROTECTED; | |
| | | | |
| /* | | /* | |
| * helper functions to find and init audio/video drivers | | * helper functions to find and init audio/video drivers | |
| * from xine's plugin collection | | * from xine's plugin collection | |
| * | | * | |
| * id : identifier of the driver, may be NULL for auto-detection | | * id : identifier of the driver, may be NULL for auto-detection | |
| | | | |
| skipping to change at line 252 | | skipping to change at line 244 | |
| * start_pos: 0..65535 | | * start_pos: 0..65535 | |
| * start_time: milliseconds | | * start_time: milliseconds | |
| * if both start position parameters are != 0 start_pos will be used | | * if both start position parameters are != 0 start_pos will be used | |
| * for non-seekable streams both values will be ignored | | * for non-seekable streams both values will be ignored | |
| * | | * | |
| * returns 1 if OK, 0 on error (use xine_get_error for details) | | * returns 1 if OK, 0 on error (use xine_get_error for details) | |
| */ | | */ | |
| int xine_play (xine_stream_t *stream, int start_pos, int start_time) XINE_
PROTECTED; | | int xine_play (xine_stream_t *stream, int start_pos, int start_time) XINE_
PROTECTED; | |
| | | | |
| /* | | /* | |
|
| * set xine to a trick mode for fast forward, backwards playback, | | | |
| * low latency seeking. Please note that this works only with some | | | |
| * input plugins. mode constants see below. | | | |
| * | | | |
| * returns 1 if OK, 0 on error (use xine_get_error for details) | | | |
| */ | | | |
| int xine_trick_mode (xine_stream_t *stream, int mode, int value) XINE_PROT | | | |
| ECTED XINE_DEPRECATED; | | | |
| | | | |
| /* trick modes */ | | | |
| #define XINE_TRICK_MODE_OFF 0 | | | |
| #define XINE_TRICK_MODE_SEEK_TO_POSITION 1 | | | |
| #define XINE_TRICK_MODE_SEEK_TO_TIME 2 | | | |
| #define XINE_TRICK_MODE_FAST_FORWARD 3 | | | |
| #define XINE_TRICK_MODE_FAST_REWIND 4 | | | |
| | | | |
| /* | | | |
| * stop stream playback | | * stop stream playback | |
| * xine_stream_t stays valid for new xine_open or xine_play | | * xine_stream_t stays valid for new xine_open or xine_play | |
| */ | | */ | |
| void xine_stop (xine_stream_t *stream) XINE_PROTECTED; | | void xine_stop (xine_stream_t *stream) XINE_PROTECTED; | |
| | | | |
| /* | | /* | |
| * stop stream playback, free all stream-related resources | | * stop stream playback, free all stream-related resources | |
| * xine_stream_t stays valid for new xine_open | | * xine_stream_t stays valid for new xine_open | |
| */ | | */ | |
| void xine_close (xine_stream_t *stream) XINE_PROTECTED; | | void xine_close (xine_stream_t *stream) XINE_PROTECTED; | |
| | | | |
| skipping to change at line 374 | | skipping to change at line 350 | |
| #define XINE_PARAM_VO_SATURATION 0x01000003 /* 0..65535
*/ | | #define XINE_PARAM_VO_SATURATION 0x01000003 /* 0..65535
*/ | |
| #define XINE_PARAM_VO_CONTRAST 0x01000004 /* 0..65535
*/ | | #define XINE_PARAM_VO_CONTRAST 0x01000004 /* 0..65535
*/ | |
| #define XINE_PARAM_VO_BRIGHTNESS 0x01000005 /* 0..65535
*/ | | #define XINE_PARAM_VO_BRIGHTNESS 0x01000005 /* 0..65535
*/ | |
| #define XINE_PARAM_VO_GAMMA 0x0100000c /* 0..65535
*/ | | #define XINE_PARAM_VO_GAMMA 0x0100000c /* 0..65535
*/ | |
| #define XINE_PARAM_VO_ZOOM_X 0x01000008 /* percent
*/ | | #define XINE_PARAM_VO_ZOOM_X 0x01000008 /* percent
*/ | |
| #define XINE_PARAM_VO_ZOOM_Y 0x0100000d /* percent
*/ | | #define XINE_PARAM_VO_ZOOM_Y 0x0100000d /* percent
*/ | |
| #define XINE_PARAM_VO_PAN_SCAN 0x01000009 /* bool
*/ | | #define XINE_PARAM_VO_PAN_SCAN 0x01000009 /* bool
*/ | |
| #define XINE_PARAM_VO_TVMODE 0x0100000a /* ???
*/ | | #define XINE_PARAM_VO_TVMODE 0x0100000a /* ???
*/ | |
| #define XINE_PARAM_VO_WINDOW_WIDTH 0x0100000f /* readonly
*/ | | #define XINE_PARAM_VO_WINDOW_WIDTH 0x0100000f /* readonly
*/ | |
| #define XINE_PARAM_VO_WINDOW_HEIGHT 0x01000010 /* readonly
*/ | | #define XINE_PARAM_VO_WINDOW_HEIGHT 0x01000010 /* readonly
*/ | |
|
| | | #define XINE_PARAM_VO_SHARPNESS 0x01000018 /* 0..65535 | |
| | | */ | |
| | | #define XINE_PARAM_VO_NOISE_REDUCTION 0x01000019 /* 0..65535 | |
| | | */ | |
| #define XINE_PARAM_VO_CROP_LEFT 0x01000020 /* crop frame pixels
*/ | | #define XINE_PARAM_VO_CROP_LEFT 0x01000020 /* crop frame pixels
*/ | |
| #define XINE_PARAM_VO_CROP_RIGHT 0x01000021 /* crop frame pixels
*/ | | #define XINE_PARAM_VO_CROP_RIGHT 0x01000021 /* crop frame pixels
*/ | |
| #define XINE_PARAM_VO_CROP_TOP 0x01000022 /* crop frame pixels
*/ | | #define XINE_PARAM_VO_CROP_TOP 0x01000022 /* crop frame pixels
*/ | |
| #define XINE_PARAM_VO_CROP_BOTTOM 0x01000023 /* crop frame pixels
*/ | | #define XINE_PARAM_VO_CROP_BOTTOM 0x01000023 /* crop frame pixels
*/ | |
| | | | |
| #define XINE_VO_ZOOM_STEP 100 | | #define XINE_VO_ZOOM_STEP 100 | |
| #define XINE_VO_ZOOM_MAX 400 | | #define XINE_VO_ZOOM_MAX 400 | |
| #define XINE_VO_ZOOM_MIN -85 | | #define XINE_VO_ZOOM_MIN -85 | |
| | | | |
| /* possible ratios for XINE_PARAM_VO_ASPECT_RATIO */ | | /* possible ratios for XINE_PARAM_VO_ASPECT_RATIO */ | |
| | | | |
| skipping to change at line 480 | | skipping to change at line 458 | |
| | | | |
| int xine_get_current_frame_data (xine_stream_t *stream, | | int xine_get_current_frame_data (xine_stream_t *stream, | |
| xine_current_frame_data_t *data, | | xine_current_frame_data_t *data, | |
| int flags) XINE_PROTECTED; | | int flags) XINE_PROTECTED; | |
| | | | |
| /* xine image formats */ | | /* xine image formats */ | |
| #define XINE_IMGFMT_YV12 (('2'<<24)|('1'<<16)|('V'<<8)|'Y') | | #define XINE_IMGFMT_YV12 (('2'<<24)|('1'<<16)|('V'<<8)|'Y') | |
| #define XINE_IMGFMT_YUY2 (('2'<<24)|('Y'<<16)|('U'<<8)|'Y') | | #define XINE_IMGFMT_YUY2 (('2'<<24)|('Y'<<16)|('U'<<8)|'Y') | |
| #define XINE_IMGFMT_XVMC (('C'<<24)|('M'<<16)|('v'<<8)|'X') | | #define XINE_IMGFMT_XVMC (('C'<<24)|('M'<<16)|('v'<<8)|'X') | |
| #define XINE_IMGFMT_XXMC (('C'<<24)|('M'<<16)|('x'<<8)|'X') | | #define XINE_IMGFMT_XXMC (('C'<<24)|('M'<<16)|('x'<<8)|'X') | |
|
| | | #define XINE_IMGFMT_VDPAU (('A'<<24)|('P'<<16)|('D'<<8)|'V') | |
| | | | |
| /* get current xine's virtual presentation timestamp (1/90000 sec) | | /* get current xine's virtual presentation timestamp (1/90000 sec) | |
| * note: this is mostly internal data. | | * note: this is mostly internal data. | |
| * one can use vpts with xine_osd_show() and xine_osd_hide(). | | * one can use vpts with xine_osd_show() and xine_osd_hide(). | |
| */ | | */ | |
| int64_t xine_get_current_vpts(xine_stream_t *stream) XINE_PROTECTED; | | int64_t xine_get_current_vpts(xine_stream_t *stream) XINE_PROTECTED; | |
| | | | |
|
| | | /* | |
| | | * Continuous video frame grabbing feature. | |
| | | * | |
| | | * In opposite to the 'xine_get_current_frame' based snapshot function this | |
| | | grabbing | |
| | | * feature allow continuous grabbing of last or next displayed video frame. | |
| | | * Grabbed video frames are returned in simple three byte RGB format. | |
| | | * | |
| | | * Depending on the capabilities of the used video output driver video imag | |
| | | e data is | |
| | | * taken as close as possible at the end of the video processing chain. Thu | |
| | | s a returned | |
| | | * video image could contain the blended OSD data, is deinterlaced, cropped | |
| | | and scaled | |
| | | * and video properties like hue, sat could be applied. | |
| | | * If a video output driver does not have a decent grabbing implementation | |
| | | then there | |
| | | * is a generic fallback feature that grabs the video frame as they are tak | |
| | | en from the video | |
| | | * display queue (like the xine_get_current_frame' function). | |
| | | * In this case color correct conversation to a RGB image incorporating sou | |
| | | rce cropping | |
| | | * and scaling to the requested grab size is also supported. | |
| | | * | |
| | | * The caller must first request a new video grab frame using the public 'x | |
| | | ine_new_grab_video_frame' | |
| | | * function. Then the caller should populate the frame with the wanted sour | |
| | | ce cropping, grab image | |
| | | * size and control flags. After that grab requests could be done by callin | |
| | | g the supplied grab() feature | |
| | | * of the frame. At the end a call to the supplied dispose() feature of the | |
| | | frame releases all needed | |
| | | * resources. | |
| | | * The caller should have acquired a port ticket while calling these featur | |
| | | es. | |
| | | * | |
| | | */ | |
| | | #define HAVE_XINE_GRAB_VIDEO_FRAME 1 | |
| | | | |
| | | /* | |
| | | * frame structure used for grabbing video frames of format RGB. | |
| | | */ | |
| | | typedef struct xine_grab_video_frame_s xine_grab_video_frame_t; | |
| | | struct xine_grab_video_frame_s { | |
| | | /* | |
| | | * grab last/next displayed image. | |
| | | * returns 0 if grab is successful, 1 on timeout and -1 on error | |
| | | */ | |
| | | int (*grab) (xine_grab_video_frame_t *self); | |
| | | | |
| | | /* | |
| | | * free all resources. | |
| | | */ | |
| | | void (*dispose) (xine_grab_video_frame_t *self); | |
| | | | |
| | | /* | |
| | | * Cropping of source image. Has to be specified by caller. | |
| | | */ | |
| | | int crop_left; | |
| | | int crop_right; | |
| | | int crop_top; | |
| | | int crop_bottom; | |
| | | | |
| | | /* | |
| | | * Parameters of returned RGB image. | |
| | | * Caller can specify wanted frame size giving width and/or height a valu | |
| | | e > 0. | |
| | | * In this case the grabbed image is scaled to the requested size. | |
| | | * Otherwise the grab function returns the actual size of the grabbed ima | |
| | | ge | |
| | | * in width/height without scaling the image. | |
| | | */ | |
| | | int width, height; /* requested/returned size of image */ | |
| | | uint8_t *img; /* returned RGB image data taking three bytes per pixe | |
| | | l */ | |
| | | int64_t vpts; /* virtual presentation timestamp (1/90000 sec) of ret | |
| | | urned frame */ | |
| | | | |
| | | int timeout; /* Max. time to wait for next displayed frame in milli | |
| | | seconds */ | |
| | | int flags; /* Controlling flags. See XINE_GRAB_VIDEO_FRAME_FLAGS_ | |
| | | * definitions */ | |
| | | }; | |
| | | | |
| | | #define XINE_GRAB_VIDEO_FRAME_FLAGS_CONTINUOUS 0x01 /* optimize resourc | |
| | | e allocation for continuous frame grabbing */ | |
| | | #define XINE_GRAB_VIDEO_FRAME_FLAGS_WAIT_NEXT 0x02 /* wait for next di | |
| | | splay frame instead of using last displayed frame */ | |
| | | | |
| | | #define XINE_GRAB_VIDEO_FRAME_DEFAULT_TIMEOUT 500 | |
| | | | |
| | | /* | |
| | | * Allocate new grab video frame. Returns NULL on error. | |
| | | */ | |
| | | xine_grab_video_frame_t* xine_new_grab_video_frame (xine_stream_t *stream) | |
| | | XINE_PROTECTED; | |
| | | | |
| /********************************************************************* | | /********************************************************************* | |
| * media processing * | | * media processing * | |
| *********************************************************************/ | | *********************************************************************/ | |
| | | | |
| #ifdef XINE_ENABLE_EXPERIMENTAL_FEATURES | | #ifdef XINE_ENABLE_EXPERIMENTAL_FEATURES | |
| | | | |
| /* | | /* | |
| * access to decoded audio and video frames from a stream | | * access to decoded audio and video frames from a stream | |
| * these functions are intended to provide the basis for | | * these functions are intended to provide the basis for | |
| * re-encoding and other video processing applications | | * re-encoding and other video processing applications | |
| | | | |
| skipping to change at line 512 | | skipping to change at line 567 | |
| * framegrab port is guaranteed to never miss a frame. | | * framegrab port is guaranteed to never miss a frame. | |
| * | | * | |
| */ | | */ | |
| | | | |
| xine_video_port_t *xine_new_framegrab_video_port (xine_t *self) XINE_PROTEC
TED; | | xine_video_port_t *xine_new_framegrab_video_port (xine_t *self) XINE_PROTEC
TED; | |
| | | | |
| typedef struct { | | typedef struct { | |
| | | | |
| int64_t vpts; /* timestamp 1/90000 sec for a/v sync */ | | int64_t vpts; /* timestamp 1/90000 sec for a/v sync */ | |
| int64_t duration; | | int64_t duration; | |
|
| | | double aspect_ratio; | |
| int width, height; | | int width, height; | |
| int colorspace; /* XINE_IMGFMT_* */ | | int colorspace; /* XINE_IMGFMT_* */ | |
|
| double aspect_ratio; | | | |
| | | | |
| int pos_stream; /* bytes from stream start */ | | int pos_stream; /* bytes from stream start */ | |
| int pos_time; /* milliseconds */ | | int pos_time; /* milliseconds */ | |
| | | | |
|
| | | int frame_number; /* frame number (may be unknown) */ | |
| | | | |
| uint8_t *data; | | uint8_t *data; | |
| void *xine_frame; /* used internally by xine engine */ | | void *xine_frame; /* used internally by xine engine */ | |
|
| | | | |
| int frame_number; /* frame number (may be unknown) */ | | | |
| } xine_video_frame_t; | | } xine_video_frame_t; | |
| | | | |
| int xine_get_next_video_frame (xine_video_port_t *port, | | int xine_get_next_video_frame (xine_video_port_t *port, | |
| xine_video_frame_t *frame) XINE_PROTECTED; | | xine_video_frame_t *frame) XINE_PROTECTED; | |
| | | | |
| void xine_free_video_frame (xine_video_port_t *port, xine_video_frame_t *fr
ame) XINE_PROTECTED; | | void xine_free_video_frame (xine_video_port_t *port, xine_video_frame_t *fr
ame) XINE_PROTECTED; | |
| | | | |
| xine_audio_port_t *xine_new_framegrab_audio_port (xine_t *self) XINE_PROTEC
TED; | | xine_audio_port_t *xine_new_framegrab_audio_port (xine_t *self) XINE_PROTEC
TED; | |
| | | | |
| typedef struct { | | typedef struct { | |
| | | | |
| int64_t vpts; /* timestamp 1/90000 sec for a/v sync */ | | int64_t vpts; /* timestamp 1/90000 sec for a/v sync */ | |
| int num_samples; | | int num_samples; | |
| int sample_rate; | | int sample_rate; | |
| int num_channels; | | int num_channels; | |
| int bits_per_sample; /* per channel */ | | int bits_per_sample; /* per channel */ | |
| | | | |
|
| off_t pos_stream; /* bytes from stream start */ | | | |
| int pos_time; /* milliseconds */ | | | |
| | | | |
| uint8_t *data; | | uint8_t *data; | |
| void *xine_frame; /* used internally by xine engine */ | | void *xine_frame; /* used internally by xine engine */ | |
|
| | | | |
| | | off_t pos_stream; /* bytes from stream start */ | |
| | | int pos_time; /* milliseconds */ | |
| } xine_audio_frame_t; | | } xine_audio_frame_t; | |
| | | | |
| int xine_get_next_audio_frame (xine_audio_port_t *port, | | int xine_get_next_audio_frame (xine_audio_port_t *port, | |
| xine_audio_frame_t *frame) XINE_PROTECTED; | | xine_audio_frame_t *frame) XINE_PROTECTED; | |
| | | | |
| void xine_free_audio_frame (xine_audio_port_t *port, xine_audio_frame_t *fr
ame) XINE_PROTECTED; | | void xine_free_audio_frame (xine_audio_port_t *port, xine_audio_frame_t *fr
ame) XINE_PROTECTED; | |
| | | | |
|
| /* | | | |
| * maybe future aproach: | | | |
| */ | | | |
| | | | |
| int xine_get_video_frame (xine_stream_t *stream, | | | |
| int timestamp, /* msec */ | | | |
| int *width, int *height, | | | |
| int *ratio_code, | | | |
| int *duration, /* msec */ | | | |
| int *format, | | | |
| uint8_t *img) XINE_PROTECTED XINE_DEPRECATED; | | | |
| | | | |
| /* TODO: xine_get_audio_frame */ | | | |
| | | | |
| #endif | | #endif | |
| | | | |
| /********************************************************************* | | /********************************************************************* | |
| * post plugin handling * | | * post plugin handling * | |
| *********************************************************************/ | | *********************************************************************/ | |
| | | | |
| /* | | /* | |
| * post effect plugin functions | | * post effect plugin functions | |
| * | | * | |
| * after the data leaves the decoder it can pass an arbitrary tree | | * after the data leaves the decoder it can pass an arbitrary tree | |
| | | | |
| skipping to change at line 622 | | skipping to change at line 663 | |
| */ | | */ | |
| xine_post_t *xine_post_init(xine_t *xine, const char *name, | | xine_post_t *xine_post_init(xine_t *xine, const char *name, | |
| int inputs, | | int inputs, | |
| xine_audio_port_t **audio_target, | | xine_audio_port_t **audio_target, | |
| xine_video_port_t **video_target) XINE_PROTECTED
; | | xine_video_port_t **video_target) XINE_PROTECTED
; | |
| | | | |
| /* get a list of all available post plugins */ | | /* get a list of all available post plugins */ | |
| const char *const *xine_list_post_plugins(xine_t *xine) XINE_PROTECTED; | | const char *const *xine_list_post_plugins(xine_t *xine) XINE_PROTECTED; | |
| | | | |
| /* get a list of all post plugins of one type */ | | /* get a list of all post plugins of one type */ | |
|
| const char *const *xine_list_post_plugins_typed(xine_t *xine, int type) XIN
E_PROTECTED; | | const char *const *xine_list_post_plugins_typed(xine_t *xine, uint32_t type
) XINE_PROTECTED; | |
| | | | |
| /* | | /* | |
| * post plugin input/output | | * post plugin input/output | |
| * | | * | |
| * These structures encapsulate inputs/outputs for post plugins | | * These structures encapsulate inputs/outputs for post plugins | |
| * to transfer arbitrary data. Frontends can also provide inputs | | * to transfer arbitrary data. Frontends can also provide inputs | |
| * and outputs and connect them to post plugins to exchange data | | * and outputs and connect them to post plugins to exchange data | |
| * with them. | | * with them. | |
| */ | | */ | |
| | | | |
| typedef struct xine_post_in_s xine_post_in_t; | | typedef struct xine_post_in_s xine_post_in_t; | |
| typedef struct xine_post_out_s xine_post_out_t; | | typedef struct xine_post_out_s xine_post_out_t; | |
| | | | |
| struct xine_post_in_s { | | struct xine_post_in_s { | |
| | | | |
| /* the name identifying this input */ | | /* the name identifying this input */ | |
| const char *name; | | const char *name; | |
| | | | |
|
| /* the datatype of this input, use one of XINE_POST_DATA_* here */ | | | |
| int type; | | | |
| | | | |
| /* the data pointer; input is directed to this memory location, | | /* the data pointer; input is directed to this memory location, | |
| * so you simply access the pointer to access the input data */ | | * so you simply access the pointer to access the input data */ | |
| void *data; | | void *data; | |
| | | | |
|
| | | /* the datatype of this input, use one of XINE_POST_DATA_* here */ | |
| | | int type; | |
| | | | |
| }; | | }; | |
| | | | |
| struct xine_post_out_s { | | struct xine_post_out_s { | |
| | | | |
| /* the name identifying this output */ | | /* the name identifying this output */ | |
| const char *name; | | const char *name; | |
| | | | |
|
| /* the datatype of this output, use one of XINE_POST_DATA_* here */ | | | |
| int type; | | | |
| | | | |
| /* the data pointer; output should be directed to this memory location, | | /* the data pointer; output should be directed to this memory location, | |
| * so in the easy case you simply write through the pointer */ | | * so in the easy case you simply write through the pointer */ | |
| void *data; | | void *data; | |
| | | | |
| /* this function is called, when the output should be redirected | | /* this function is called, when the output should be redirected | |
| * to another input, you sould set the data pointer to direct | | * to another input, you sould set the data pointer to direct | |
| * any output to this new input; | | * any output to this new input; | |
| * a special situation is, when this function is called with a NULL | | * a special situation is, when this function is called with a NULL | |
| * argument: in this case you should disconnect the data pointer | | * argument: in this case you should disconnect the data pointer | |
| * from any output and if necessary to avoid writing to some stray | | * from any output and if necessary to avoid writing to some stray | |
| * memory you should make it point to some dummy location, | | * memory you should make it point to some dummy location, | |
| * returns 1 on success, 0 on failure; | | * returns 1 on success, 0 on failure; | |
| * if you do not implement rewiring, set this to NULL */ | | * if you do not implement rewiring, set this to NULL */ | |
| int (*rewire) (xine_post_out_t *self, void *data); | | int (*rewire) (xine_post_out_t *self, void *data); | |
| | | | |
|
| | | /* the datatype of this output, use one of XINE_POST_DATA_* here */ | |
| | | int type; | |
| | | | |
| }; | | }; | |
| | | | |
| /* get a list of all inputs of a post plugin */ | | /* get a list of all inputs of a post plugin */ | |
| const char *const *xine_post_list_inputs(xine_post_t *self) XINE_PROTECTED; | | const char *const *xine_post_list_inputs(xine_post_t *self) XINE_PROTECTED; | |
| | | | |
| /* get a list of all outputs of a post plugin */ | | /* get a list of all outputs of a post plugin */ | |
| const char *const *xine_post_list_outputs(xine_post_t *self) XINE_PROTECTED
; | | const char *const *xine_post_list_outputs(xine_post_t *self) XINE_PROTECTED
; | |
| | | | |
| /* retrieve one specific input of a post plugin */ | | /* retrieve one specific input of a post plugin */ | |
| xine_post_in_t *xine_post_input(xine_post_t *self, const char *name) XINE_P
ROTECTED; | | xine_post_in_t *xine_post_input(xine_post_t *self, const char *name) XINE_P
ROTECTED; | |
| | | | |
| skipping to change at line 769 | | skipping to change at line 810 | |
| #define XINE_POST_DATA_DOUBLE 4 | | #define XINE_POST_DATA_DOUBLE 4 | |
| | | | |
| /* parameters api (used by frontends) | | /* parameters api (used by frontends) | |
| * input->data is xine_post_api_t* (see below) | | * input->data is xine_post_api_t* (see below) | |
| */ | | */ | |
| #define XINE_POST_DATA_PARAMETERS 5 | | #define XINE_POST_DATA_PARAMETERS 5 | |
| | | | |
| /* defines a single parameter entry. */ | | /* defines a single parameter entry. */ | |
| typedef struct { | | typedef struct { | |
| int type; /* POST_PARAM_TYPE_xxx */ | | int type; /* POST_PARAM_TYPE_xxx */ | |
|
| char *name; /* name of this parameter */ | | const char *name; /* name of this parameter */ | |
| int size; /* sizeof(parameter) */ | | int size; /* sizeof(parameter) */ | |
| int offset; /* offset in bytes from struct ptr */ | | int offset; /* offset in bytes from struct ptr */ | |
| char **enum_values; /* enumeration (first=0) or NULL */ | | char **enum_values; /* enumeration (first=0) or NULL */ | |
| double range_min; /* minimum value */ | | double range_min; /* minimum value */ | |
| double range_max; /* maximum value */ | | double range_max; /* maximum value */ | |
| int readonly; /* 0 = read/write, 1=read-only */ | | int readonly; /* 0 = read/write, 1=read-only */ | |
|
| char *description; /* user-friendly description */ | | const char *description; /* user-friendly description */ | |
| } xine_post_api_parameter_t; | | } xine_post_api_parameter_t; | |
| | | | |
| /* description of parameters struct (params). */ | | /* description of parameters struct (params). */ | |
| typedef struct { | | typedef struct { | |
| int struct_size; /* sizeof(params) */ | | int struct_size; /* sizeof(params) */ | |
| xine_post_api_parameter_t *parameter; /* list of parameters */ | | xine_post_api_parameter_t *parameter; /* list of parameters */ | |
| } xine_post_api_descr_t; | | } xine_post_api_descr_t; | |
| | | | |
| typedef struct { | | typedef struct { | |
| /* | | /* | |
| | | | |
| skipping to change at line 887 | | skipping to change at line 928 | |
| * (use -1 for current channel) | | * (use -1 for current channel) | |
| * | | * | |
| * lang must point to a buffer of at least XINE_LANG_MAX bytes | | * lang must point to a buffer of at least XINE_LANG_MAX bytes | |
| * | | * | |
| * returns 1 on success, 0 on failure | | * returns 1 on success, 0 on failure | |
| */ | | */ | |
| int xine_get_audio_lang (xine_stream_t *stream, int channel, | | int xine_get_audio_lang (xine_stream_t *stream, int channel, | |
| char *lang) XINE_PROTECTED; | | char *lang) XINE_PROTECTED; | |
| int xine_get_spu_lang (xine_stream_t *stream, int channel, | | int xine_get_spu_lang (xine_stream_t *stream, int channel, | |
| char *lang) XINE_PROTECTED; | | char *lang) XINE_PROTECTED; | |
|
| | | /*_x_ increasing this number means an incompatible ABI breakage! */ | |
| #define XINE_LANG_MAX 32 | | #define XINE_LANG_MAX 32 | |
| | | | |
| /* | | /* | |
| * get position / length information | | * get position / length information | |
| * | | * | |
| * depending of the nature and system layer of the stream, | | * depending of the nature and system layer of the stream, | |
| * some or all of this information may be unavailable or incorrect | | * some or all of this information may be unavailable or incorrect | |
| * (e.g. live network streams may not have a valid length) | | * (e.g. live network streams may not have a valid length) | |
| * | | * | |
| * returns 1 on success, 0 on failure (data was not updated, | | * returns 1 on success, 0 on failure (data was not updated, | |
| | | | |
| skipping to change at line 1019 | | skipping to change at line 1061 | |
| * by some of these functions are pointers to statically | | * by some of these functions are pointers to statically | |
| * alloced internal xine memory chunks. | | * alloced internal xine memory chunks. | |
| * they're only valid between xine function calls | | * they're only valid between xine function calls | |
| * and should never be free()d. | | * and should never be free()d. | |
| */ | | */ | |
| | | | |
| typedef struct { | | typedef struct { | |
| char *origin; /* file plugin: path */ | | char *origin; /* file plugin: path */ | |
| char *mrl; /* <type>://<location> */ | | char *mrl; /* <type>://<location> */ | |
| char *link; | | char *link; | |
|
| uint32_t type; /* see below */ | | | |
| off_t size; /* size of this source, may be 0 */ | | off_t size; /* size of this source, may be 0 */ | |
|
| | | uint32_t type; /* see below */ | |
| } xine_mrl_t; | | } xine_mrl_t; | |
| | | | |
| /* mrl types */ | | /* mrl types */ | |
| #define XINE_MRL_TYPE_unknown (0 << 0) | | #define XINE_MRL_TYPE_unknown (0 << 0) | |
| #define XINE_MRL_TYPE_dvd (1 << 0) | | #define XINE_MRL_TYPE_dvd (1 << 0) | |
| #define XINE_MRL_TYPE_vcd (1 << 1) | | #define XINE_MRL_TYPE_vcd (1 << 1) | |
| #define XINE_MRL_TYPE_net (1 << 2) | | #define XINE_MRL_TYPE_net (1 << 2) | |
| #define XINE_MRL_TYPE_rtp (1 << 3) | | #define XINE_MRL_TYPE_rtp (1 << 3) | |
| #define XINE_MRL_TYPE_stdin (1 << 4) | | #define XINE_MRL_TYPE_stdin (1 << 4) | |
| #define XINE_MRL_TYPE_cda (1 << 5) | | #define XINE_MRL_TYPE_cda (1 << 5) | |
| | | | |
| skipping to change at line 1063 | | skipping to change at line 1105 | |
| */ | | */ | |
| xine_mrl_t **xine_get_browse_mrls (xine_t *self, | | xine_mrl_t **xine_get_browse_mrls (xine_t *self, | |
| const char *plugin_id, | | const char *plugin_id, | |
| const char *start_mrl, | | const char *start_mrl, | |
| int *num_mrls) XINE_PROTECTED; | | int *num_mrls) XINE_PROTECTED; | |
| | | | |
| /* get a list of plugins that support the autoplay feature */ | | /* get a list of plugins that support the autoplay feature */ | |
| const char *const *xine_get_autoplay_input_plugin_ids (xine_t *self) XINE_P
ROTECTED; | | const char *const *xine_get_autoplay_input_plugin_ids (xine_t *self) XINE_P
ROTECTED; | |
| | | | |
| /* get autoplay MRL list from input plugin named <plugin_id> */ | | /* get autoplay MRL list from input plugin named <plugin_id> */ | |
|
| char **xine_get_autoplay_mrls (xine_t *self, | | const char * const *xine_get_autoplay_mrls (xine_t *self, | |
| const char *plugin_id, | | const char *plugin_id, | |
| int *num_mrls) XINE_PROTECTED; | | int *num_mrls) XINE_PROTECTED; | |
| | | | |
| /* get a list of file extensions for file types supported by xine | | /* get a list of file extensions for file types supported by xine | |
| * the list is separated by spaces | | * the list is separated by spaces | |
| * | | * | |
| * the pointer returned can be free()ed when no longer used */ | | * the pointer returned can be free()ed when no longer used */ | |
| char *xine_get_file_extensions (xine_t *self) XINE_PROTECTED; | | char *xine_get_file_extensions (xine_t *self) XINE_PROTECTED; | |
| | | | |
| /* get a list of mime types supported by xine | | /* get a list of mime types supported by xine | |
| * | | * | |
| * the pointer returned can be free()ed when no longer used */ | | * the pointer returned can be free()ed when no longer used */ | |
| | | | |
| skipping to change at line 1128 | | skipping to change at line 1170 | |
| const char *const *xine_list_audio_decoder_plugins(xine_t *self) XINE_PROTE
CTED; | | const char *const *xine_list_audio_decoder_plugins(xine_t *self) XINE_PROTE
CTED; | |
| const char *const *xine_list_video_decoder_plugins(xine_t *self) XINE_PROTE
CTED; | | const char *const *xine_list_video_decoder_plugins(xine_t *self) XINE_PROTE
CTED; | |
| | | | |
| /* unload unused plugins */ | | /* unload unused plugins */ | |
| void xine_plugins_garbage_collector(xine_t *self) XINE_PROTECTED; | | void xine_plugins_garbage_collector(xine_t *self) XINE_PROTECTED; | |
| | | | |
| /********************************************************************* | | /********************************************************************* | |
| * visual specific gui <-> xine engine communication * | | * visual specific gui <-> xine engine communication * | |
| *********************************************************************/ | | *********************************************************************/ | |
| | | | |
|
| #ifndef XINE_DISABLE_DEPRECATED_FEATURES | | | |
| /* talk to video output driver - old method */ | | | |
| int xine_gui_send_vo_data (xine_stream_t *self, | | | |
| int type, void *data) XINE_PROTECTED XINE_DEPR | | | |
| ECATED; | | | |
| #endif | | | |
| | | | |
| /* new (preferred) method to talk to video driver. */ | | /* new (preferred) method to talk to video driver. */ | |
| int xine_port_send_gui_data (xine_video_port_t *vo, | | int xine_port_send_gui_data (xine_video_port_t *vo, | |
| int type, void *data) XINE_PROTECTED; | | int type, void *data) XINE_PROTECTED; | |
| | | | |
| typedef struct { | | typedef struct { | |
| | | | |
| /* area of that drawable to be used by video */ | | /* area of that drawable to be used by video */ | |
| int x,y,w,h; | | int x,y,w,h; | |
| | | | |
| } x11_rectangle_t; | | } x11_rectangle_t; | |
| | | | |
| skipping to change at line 1482 | | skipping to change at line 1518 | |
| | | | |
| #define CHECK_KERNEL 0 | | #define CHECK_KERNEL 0 | |
| #define CHECK_MTRR 1 | | #define CHECK_MTRR 1 | |
| #define CHECK_CDROM 2 | | #define CHECK_CDROM 2 | |
| #define CHECK_DVDROM 3 | | #define CHECK_DVDROM 3 | |
| #define CHECK_DMA 4 | | #define CHECK_DMA 4 | |
| #define CHECK_X 5 | | #define CHECK_X 5 | |
| #define CHECK_XV 6 | | #define CHECK_XV 6 | |
| | | | |
| struct xine_health_check_s { | | struct xine_health_check_s { | |
|
| int status; | | | |
| const char* cdrom_dev; | | const char* cdrom_dev; | |
| const char* dvd_dev; | | const char* dvd_dev; | |
|
| char* msg; | | const char* msg; | |
| char* title; | | const char* title; | |
| char* explanation; | | const char* explanation; | |
| | | int status; | |
| }; | | }; | |
| | | | |
| typedef struct xine_health_check_s xine_health_check_t; | | typedef struct xine_health_check_s xine_health_check_t; | |
| xine_health_check_t* xine_health_check(xine_health_check_t*, int check_num)
XINE_PROTECTED; | | xine_health_check_t* xine_health_check(xine_health_check_t*, int check_num)
XINE_PROTECTED; | |
| | | | |
| /********************************************************************* | | /********************************************************************* | |
| * configuration system * | | * configuration system * | |
| *********************************************************************/ | | *********************************************************************/ | |
| | | | |
| /* | | /* | |
| | | | |
| skipping to change at line 1523 | | skipping to change at line 1559 | |
| | | | |
| typedef struct xine_cfg_entry_s xine_cfg_entry_t; | | typedef struct xine_cfg_entry_s xine_cfg_entry_t; | |
| | | | |
| typedef void (*xine_config_cb_t) (void *user_data, | | typedef void (*xine_config_cb_t) (void *user_data, | |
| xine_cfg_entry_t *entry); | | xine_cfg_entry_t *entry); | |
| struct xine_cfg_entry_s { | | struct xine_cfg_entry_s { | |
| const char *key; /* unique id (example: gui.logo_mrl) */ | | const char *key; /* unique id (example: gui.logo_mrl) */ | |
| | | | |
| int type; | | int type; | |
| | | | |
|
| | | /* user experience level */ | |
| | | int exp_level; /* 0 => beginner, | |
| | | 10 => advanced user, | |
| | | 20 => expert */ | |
| | | | |
| /* type unknown */ | | /* type unknown */ | |
| char *unknown_value; | | char *unknown_value; | |
| | | | |
| /* type string */ | | /* type string */ | |
| char *str_value; | | char *str_value; | |
| char *str_default; | | char *str_default; | |
|
| #ifndef XINE_DISABLE_DEPRECATED_FEATURES | | | |
| char *str_sticky; | | | |
| #else | | | |
| void *dummy; | | | |
| #endif | | | |
| | | | |
| /* common to range, enum, num, bool; | | /* common to range, enum, num, bool; | |
| * num_value is also used by string to indicate what's required: | | * num_value is also used by string to indicate what's required: | |
| * plain string, file name, device name, directory name | | * plain string, file name, device name, directory name | |
| */ | | */ | |
| int num_value; | | int num_value; | |
| int num_default; | | int num_default; | |
| | | | |
| /* type range specific: */ | | /* type range specific: */ | |
| int range_min; | | int range_min; | |
| | | | |
| skipping to change at line 1556 | | skipping to change at line 1592 | |
| /* type enum specific: */ | | /* type enum specific: */ | |
| char **enum_values; | | char **enum_values; | |
| | | | |
| /* help info for the user (UTF-8) | | /* help info for the user (UTF-8) | |
| * the help string must be word wrapped by the frontend. | | * the help string must be word wrapped by the frontend. | |
| * it might contain \n to mark paragraph breaks. | | * it might contain \n to mark paragraph breaks. | |
| */ | | */ | |
| const char *description; | | const char *description; | |
| const char *help; | | const char *help; | |
| | | | |
|
| /* user experience level */ | | | |
| int exp_level; /* 0 => beginner, | | | |
| 10 => advanced user, | | | |
| 20 => expert */ | | | |
| | | | |
| /* callback function and data for live changeable values */ | | /* callback function and data for live changeable values */ | |
| /* some config entries will take effect immediately, although they | | /* some config entries will take effect immediately, although they | |
| * do not have a callback registered; such values will have some | | * do not have a callback registered; such values will have some | |
| * non-NULL dummy value in callback_data; so if you want to check, | | * non-NULL dummy value in callback_data; so if you want to check, | |
| * if a config change will require restarting xine, check for | | * if a config change will require restarting xine, check for | |
| * callback_data == NULL */ | | * callback_data == NULL */ | |
| xine_config_cb_t callback; | | xine_config_cb_t callback; | |
| void *callback_data; | | void *callback_data; | |
| | | | |
| }; | | }; | |
| | | | |
| skipping to change at line 1802 | | skipping to change at line 1833 | |
| #define XINE_EVENT_VDR_PLUGINSTARTED 354 | | #define XINE_EVENT_VDR_PLUGINSTARTED 354 | |
| #define XINE_EVENT_VDR_DISCONTINUITY 355 | | #define XINE_EVENT_VDR_DISCONTINUITY 355 | |
| | | | |
| /* events generated from post plugins */ | | /* events generated from post plugins */ | |
| #define XINE_EVENT_POST_TVTIME_FILMMODE_CHANGE 400 | | #define XINE_EVENT_POST_TVTIME_FILMMODE_CHANGE 400 | |
| | | | |
| /* | | /* | |
| * xine event struct | | * xine event struct | |
| */ | | */ | |
| typedef struct { | | typedef struct { | |
|
| int type; /* event type (constants see abo
ve) */ | | | |
| xine_stream_t *stream; /* stream this event belongs to
*/ | | xine_stream_t *stream; /* stream this event belongs to
*/ | |
| | | | |
| void *data; /* contents depending on type */ | | void *data; /* contents depending on type */ | |
| int data_length; | | int data_length; | |
| | | | |
|
| | | int type; /* event type (constants see abo | |
| | | ve) */ | |
| | | | |
| /* you do not have to provide this, it will be filled in by xine_event_se
nd() */ | | /* you do not have to provide this, it will be filled in by xine_event_se
nd() */ | |
| struct timeval tv; /* timestamp of event creation *
/ | | struct timeval tv; /* timestamp of event creation *
/ | |
| } xine_event_t; | | } xine_event_t; | |
| | | | |
| /* | | /* | |
| * input event dynamic data | | * input event dynamic data | |
| */ | | */ | |
| typedef struct { | | typedef struct { | |
| xine_event_t event; | | xine_event_t event; | |
| uint8_t button; /* Generally 1 = left, 2 = mid, 3 = right */ | | uint8_t button; /* Generally 1 = left, 2 = mid, 3 = right */ | |
| | | | |
| skipping to change at line 2080 | | skipping to change at line 2112 | |
| #define XINE_MSG_NETWORK_UNREACHABLE 4 /* none */ | | #define XINE_MSG_NETWORK_UNREACHABLE 4 /* none */ | |
| #define XINE_MSG_CONNECTION_REFUSED 5 /* (host name) */ | | #define XINE_MSG_CONNECTION_REFUSED 5 /* (host name) */ | |
| #define XINE_MSG_FILE_NOT_FOUND 6 /* (file name or mrl) */ | | #define XINE_MSG_FILE_NOT_FOUND 6 /* (file name or mrl) */ | |
| #define XINE_MSG_READ_ERROR 7 /* (device/file/mrl) */ | | #define XINE_MSG_READ_ERROR 7 /* (device/file/mrl) */ | |
| #define XINE_MSG_LIBRARY_LOAD_ERROR 8 /* (library/decoder) */ | | #define XINE_MSG_LIBRARY_LOAD_ERROR 8 /* (library/decoder) */ | |
| #define XINE_MSG_ENCRYPTED_SOURCE 9 /* none */ | | #define XINE_MSG_ENCRYPTED_SOURCE 9 /* none */ | |
| #define XINE_MSG_SECURITY 10 /* (security message) */ | | #define XINE_MSG_SECURITY 10 /* (security message) */ | |
| #define XINE_MSG_AUDIO_OUT_UNAVAILABLE 11 /* none */ | | #define XINE_MSG_AUDIO_OUT_UNAVAILABLE 11 /* none */ | |
| #define XINE_MSG_PERMISSION_ERROR 12 /* (file name or mrl) */ | | #define XINE_MSG_PERMISSION_ERROR 12 /* (file name or mrl) */ | |
| #define XINE_MSG_FILE_EMPTY 13 /* file is empty */ | | #define XINE_MSG_FILE_EMPTY 13 /* file is empty */ | |
|
| | | #define XINE_MSG_AUTHENTICATION_NEEDED 14 /* (mrl, likely http) */ | |
| | | | |
| /* opaque xine_event_queue_t */ | | /* opaque xine_event_queue_t */ | |
| typedef struct xine_event_queue_s xine_event_queue_t; | | typedef struct xine_event_queue_s xine_event_queue_t; | |
| | | | |
| /* | | /* | |
| * register a new event queue | | * register a new event queue | |
| * | | * | |
| * you have to receive messages from this queue regularly | | * you have to receive messages from this queue regularly | |
| * | | * | |
| * use xine_event_dispose_queue to unregister and free the queue | | * use xine_event_dispose_queue to unregister and free the queue | |
| | | | |
| skipping to change at line 2152 | | skipping to change at line 2185 | |
| | | | |
| /* white text, black border, transparent background */ | | /* white text, black border, transparent background */ | |
| #define XINE_TEXTPALETTE_WHITE_BLACK_TRANSPARENT 0 | | #define XINE_TEXTPALETTE_WHITE_BLACK_TRANSPARENT 0 | |
| /* white text, noborder, transparent background */ | | /* white text, noborder, transparent background */ | |
| #define XINE_TEXTPALETTE_WHITE_NONE_TRANSPARENT 1 | | #define XINE_TEXTPALETTE_WHITE_NONE_TRANSPARENT 1 | |
| /* white text, no border, translucid background */ | | /* white text, no border, translucid background */ | |
| #define XINE_TEXTPALETTE_WHITE_NONE_TRANSLUCID 2 | | #define XINE_TEXTPALETTE_WHITE_NONE_TRANSLUCID 2 | |
| /* yellow text, black border, transparent background */ | | /* yellow text, black border, transparent background */ | |
| #define XINE_TEXTPALETTE_YELLOW_BLACK_TRANSPARENT 3 | | #define XINE_TEXTPALETTE_YELLOW_BLACK_TRANSPARENT 3 | |
| | | | |
|
| #define XINE_OSD_CAP_FREETYPE2 0x0001 /* freetype2 support compiled in | | #define XINE_OSD_CAP_FREETYPE2 0x0001 /* freetype2 support compiled in | |
| */ | | */ | |
| #define XINE_OSD_CAP_UNSCALED 0x0002 /* unscaled overlays supp. by vo drv | | #define XINE_OSD_CAP_UNSCALED 0x0002 /* unscaled overlays supp. by vo | |
| */ | | drv */ | |
| | | #define XINE_OSD_CAP_CUSTOM_EXTENT 0x0004 /* hardware scaled to match video | |
| | | output window */ | |
| | | #define XINE_OSD_CAP_ARGB_LAYER 0x0008 /* supports ARGB true color pixma | |
| | | ps */ | |
| | | #define XINE_OSD_CAP_VIDEO_WINDOW 0x0010 /* can scale video to an area wit | |
| | | hin osd extent */ | |
| | | | |
| typedef struct xine_osd_s xine_osd_t; | | typedef struct xine_osd_s xine_osd_t; | |
| | | | |
| xine_osd_t *xine_osd_new (xine_stream_t *self, int x, int y, | | xine_osd_t *xine_osd_new (xine_stream_t *self, int x, int y, | |
| int width, int height) XINE_PROTECTED; | | int width, int height) XINE_PROTECTED; | |
| uint32_t xine_osd_get_capabilities (xine_osd_t *self) XINE_PROTECTED; | | uint32_t xine_osd_get_capabilities (xine_osd_t *self) XINE_PROTECTED; | |
| void xine_osd_draw_point (xine_osd_t *self, int x, int y, int col
or) XINE_PROTECTED; | | void xine_osd_draw_point (xine_osd_t *self, int x, int y, int col
or) XINE_PROTECTED; | |
| | | | |
| void xine_osd_draw_line (xine_osd_t *self, int x1, int y1, | | void xine_osd_draw_line (xine_osd_t *self, int x1, int y1, | |
| int x2, int y2, int color) XINE_PROTECTE
D; | | int x2, int y2, int color) XINE_PROTECTE
D; | |
| | | | |
| skipping to change at line 2218 | | skipping to change at line 2254 | |
| */ | | */ | |
| void xine_osd_set_text_palette (xine_osd_t *self, | | void xine_osd_set_text_palette (xine_osd_t *self, | |
| int palette_number, | | int palette_number, | |
| int color_base ) XINE_PROTECTED; | | int color_base ) XINE_PROTECTED; | |
| /* get palette (color and transparency) */ | | /* get palette (color and transparency) */ | |
| void xine_osd_get_palette (xine_osd_t *self, uint32_t *color, | | void xine_osd_get_palette (xine_osd_t *self, uint32_t *color, | |
| uint8_t *trans) XINE_PROTECTED; | | uint8_t *trans) XINE_PROTECTED; | |
| void xine_osd_set_palette (xine_osd_t *self, | | void xine_osd_set_palette (xine_osd_t *self, | |
| const uint32_t *const color, | | const uint32_t *const color, | |
| const uint8_t *const trans ) XINE_PROTEC
TED; | | const uint8_t *const trans ) XINE_PROTEC
TED; | |
|
| | | | |
| /* | | /* | |
|
| * close osd rendering engine | | * Set an ARGB buffer to be blended into video. | |
| * loaded fonts are unloaded | | * The buffer must stay valid while the OSD is on screen. | |
| * osd objects are closed | | * Pass a NULL pointer to safely remove the buffer from | |
| | | * the OSD layer. Only the dirty area will be | |
| | | * updated on screen. For convenience the whole | |
| | | * OSD object will be considered dirty when setting | |
| | | * a different buffer pointer. | |
| | | * see also XINE_OSD_CAP_ARGB_LAYER | |
| */ | | */ | |
|
| void xine_osd_free (xine_osd_t *self) XINE_PROTECTED; | | void xine_osd_set_argb_buffer(xine_osd_t *self, uint32_t *argb_buffer, | |
| | | int dirty_x, int dirty_y, int dirty_width, in | |
| #ifndef XINE_DISABLE_DEPRECATED_FEATURES | | t dirty_height) XINE_PROTECTED; | |
| | | | |
| /********************************************************************* | | | |
| * TV-mode API, to make it possible to use nvtvd to view movies * | | | |
| *********************************************************************/ | | | |
| | | | |
| /* These functions are just dummies to maintain API compatibility. | | | |
| * You should use libnvtvsimple in your frontend instead. */ | | | |
| | | | |
| typedef enum { | | | |
| XINE_TVSYSTEM_PAL = 0, | | | |
| XINE_TVSYSTEM_NTSC | | | |
| } xine_tvsystem XINE_DEPRECATED; | | | |
| | | | |
| /* connect to nvtvd server and save current TV and X settings */ | | | |
| int xine_tvmode_init (xine_t *self) XINE_PROTECTED XINE_DEPRECATED; | | | |
| | | | |
| /* Turn tvmode on/off (1/0)*/ | | | |
| int xine_tvmode_use(xine_t *self, int use_tvmode) XINE_PROTECTED XINE_DEPRE | | | |
| CATED; | | | |
| | | | |
| /* Set which tv system to use: XINE_TVSYSTEM_PAL or XINE_TVSYSTEM_NTSC */ | | | |
| void xine_tvmode_set_tvsystem(xine_t *self, xine_tvsystem system) XINE_PROT | | | |
| ECTED XINE_DEPRECATED; | | | |
| | | | |
|
| /* try to change TV state if enabled | | /* | |
| * type select 'regular' (0) or 'TV' (1) state | | * define extent of reference coordinate system | |
| * width frame width the mode should match best or 0 if unknown | | * for video resolution independent osds. | |
| * height frame height the mode should match best or 0 if unknown | | * see also XINE_OSD_CAP_CUSTOM_EXTENT | |
| * fps frame rate the mode should match best or 0 if unknown | | | |
| * returns: finally selected state | | | |
| */ | | */ | |
|
| int xine_tvmode_switch (xine_t *self, int type, int width, int height, doub
le fps) XINE_PROTECTED XINE_DEPRECATED; | | void xine_osd_set_extent(xine_osd_t *self, int extent_width, int extent_hei
ght) XINE_PROTECTED; | |
| | | | |
|
| /* adapt (maximum) output size to visible area if necessary and return pixe | | /* | |
| l | | * define area within osd extent to output | |
| * aspect and real frame rate if available | | * video to while osd is on screen | |
| | | * see also XINE_OSD_CAP_VIDEO_WINDOW | |
| */ | | */ | |
|
| void xine_tvmode_size (xine_t *self, int *width, int *height, | | void xine_osd_set_video_window(xine_osd_t *self, int window_x, int window_y | |
| double *pixelratio, double *fps) XINE_PROTECTED XINE_ | | , int window_width, int window_height) XINE_PROTECTED; | |
| DEPRECATED; | | | |
| | | | |
| /* restore old TV and X settings and close nvtvd connection */ | | | |
| void xine_tvmode_exit (xine_t *self) XINE_PROTECTED XINE_DEPRECATED; | | | |
| | | | |
|
| #endif | | /* | |
| | | * close osd rendering engine | |
| | | * loaded fonts are unloaded | |
| | | * osd objects are closed | |
| | | */ | |
| | | void xine_osd_free (xine_osd_t *self) XINE_PROTECTED; | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| } | | } | |
| #endif | | #endif | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 46 change blocks. |
| 139 lines changed or deleted | | 183 lines changed or added | |
|
| xine_internal.h | | xine_internal.h | |
| | | | |
| skipping to change at line 32 | | skipping to change at line 32 | |
| #define HAVE_XINE_INTERNAL_H | | #define HAVE_XINE_INTERNAL_H | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| extern "C" { | | extern "C" { | |
| #endif | | #endif | |
| | | | |
| /* | | /* | |
| * include public part of xine header | | * include public part of xine header | |
| */ | | */ | |
| | | | |
|
| #ifdef XINE_COMPILE | | #include <xine.h> | |
| # include "xine.h" | | #include <xine/refcounter.h> | |
| # include "refcounter.h" | | #include <xine/input_plugin.h> | |
| # include "input/input_plugin.h" | | #include <xine/demux.h> | |
| # include "demuxers/demux.h" | | #include <xine/video_out.h> | |
| # include "video_out.h" | | #include <xine/audio_out.h> | |
| # include "audio_out.h" | | #include <xine/metronom.h> | |
| # include "metronom.h" | | #include <xine/osd.h> | |
| # include "osd.h" | | #include <xine/xineintl.h> | |
| # include "xineintl.h" | | #include <xine/plugin_catalog.h> | |
| # include "plugin_catalog.h" | | #include <xine/video_decoder.h> | |
| # include "video_decoder.h" | | #include <xine/audio_decoder.h> | |
| # include "audio_decoder.h" | | #include <xine/spu_decoder.h> | |
| # include "spu_decoder.h" | | #include <xine/scratch.h> | |
| # include "scratch.h" | | #include <xine/broadcaster.h> | |
| # include "broadcaster.h" | | #include <xine/io_helper.h> | |
| # include "io_helper.h" | | #include <xine/info_helper.h> | |
| # include "info_helper.h" | | #include <xine/alphablend.h> | |
| # include "alphablend.h" | | | |
| #else | | | |
| # include <xine.h> | | | |
| # include <xine/refcounter.h> | | | |
| # include <xine/input_plugin.h> | | | |
| # include <xine/demux.h> | | | |
| # include <xine/video_out.h> | | | |
| # include <xine/audio_out.h> | | | |
| # include <xine/metronom.h> | | | |
| # include <xine/osd.h> | | | |
| # include <xine/xineintl.h> | | | |
| # include <xine/plugin_catalog.h> | | | |
| # include <xine/video_decoder.h> | | | |
| # include <xine/audio_decoder.h> | | | |
| # include <xine/spu_decoder.h> | | | |
| # include <xine/scratch.h> | | | |
| # include <xine/broadcaster.h> | | | |
| # include <xine/io_helper.h> | | | |
| # include <xine/info_helper.h> | | | |
| # include <xine/alphablend.h> | | | |
| #endif | | | |
| | | | |
| #define XINE_MAX_EVENT_LISTENERS 50 | | #define XINE_MAX_EVENT_LISTENERS 50 | |
| #define XINE_MAX_EVENT_TYPES 100 | | #define XINE_MAX_EVENT_TYPES 100 | |
| #define XINE_MAX_TICKET_HOLDER_THREADS 64 | | #define XINE_MAX_TICKET_HOLDER_THREADS 64 | |
| | | | |
| /* used by plugin loader */ | | /* used by plugin loader */ | |
| #define XINE_VERSION_CODE XINE_MAJOR_VERSION*10000+XINE_MINO
R_VERSION*100+XINE_SUB_VERSION | | #define XINE_VERSION_CODE XINE_MAJOR_VERSION*10000+XINE_MINO
R_VERSION*100+XINE_SUB_VERSION | |
| | | | |
| /* | | /* | |
| * log constants | | * log constants | |
| | | | |
| skipping to change at line 96 | | skipping to change at line 75 | |
| #define XINE_LOG_NUM 3 /* # of log buffers defined */ | | #define XINE_LOG_NUM 3 /* # of log buffers defined */ | |
| | | | |
| #define XINE_STREAM_INFO_MAX 99 | | #define XINE_STREAM_INFO_MAX 99 | |
| | | | |
| typedef struct xine_ticket_s xine_ticket_t; | | typedef struct xine_ticket_s xine_ticket_t; | |
| | | | |
| /* | | /* | |
| * the "big" xine struct, holding everything together | | * the "big" xine struct, holding everything together | |
| */ | | */ | |
| | | | |
|
| | | #ifndef XDG_BASEDIR_H | |
| | | /* present here for internal convenience only */ | |
| | | typedef struct { void *reserved; } xdgHandle; | |
| | | #endif | |
| | | | |
| struct xine_s { | | struct xine_s { | |
| | | | |
| config_values_t *config; | | config_values_t *config; | |
| | | | |
| plugin_catalog_t *plugin_catalog; | | plugin_catalog_t *plugin_catalog; | |
| | | | |
|
| | | int verbosity; | |
| | | | |
| int demux_strategy; | | int demux_strategy; | |
| char *save_path; | | char *save_path; | |
| | | | |
| /* log output that may be presented to the user */ | | /* log output that may be presented to the user */ | |
| scratch_buffer_t *log_buffers[XINE_LOG_NUM]; | | scratch_buffer_t *log_buffers[XINE_LOG_NUM]; | |
| | | | |
|
| int verbosity; | | | |
| | | | |
| xine_list_t *streams; | | xine_list_t *streams; | |
| pthread_mutex_t streams_lock; | | pthread_mutex_t streams_lock; | |
| | | | |
| metronom_clock_t *clock; | | metronom_clock_t *clock; | |
| | | | |
|
| | | /** Handle for libxdg-basedir functions. */ | |
| | | xdgHandle basedir_handle; | |
| | | | |
| #ifdef XINE_ENGINE_INTERNAL | | #ifdef XINE_ENGINE_INTERNAL | |
| xine_ticket_t *port_ticket; | | xine_ticket_t *port_ticket; | |
| pthread_mutex_t log_lock; | | pthread_mutex_t log_lock; | |
| | | | |
| xine_log_cb_t log_cb; | | xine_log_cb_t log_cb; | |
| void *log_cb_user_data; | | void *log_cb_user_data; | |
| #endif | | #endif | |
| }; | | }; | |
| | | | |
|
| | | /* FIXME-ABI Some global flag bits */ | |
| | | /* See xine_set_flags() */ | |
| | | #ifdef XINE_ENGINE_INTERNAL | |
| | | extern int _x_flags XINE_PROTECTED; | |
| | | #endif | |
| | | | |
| /* | | /* | |
| * xine thread tickets | | * xine thread tickets | |
| */ | | */ | |
| | | | |
| struct xine_ticket_s { | | struct xine_ticket_s { | |
| | | | |
| /* the ticket owner must assure to check for ticket revocation in | | /* the ticket owner must assure to check for ticket revocation in | |
| * intervals of finite length; this means that you must release | | * intervals of finite length; this means that you must release | |
| * the ticket before any operation that might block | | * the ticket before any operation that might block | |
| * | | * | |
| | | | |
| skipping to change at line 170 | | skipping to change at line 163 | |
| | | | |
| /* behaves like acquire() but doesn't block the calling thread; when | | /* behaves like acquire() but doesn't block the calling thread; when | |
| * the thread would have been blocked, 0 is returned otherwise 1 | | * the thread would have been blocked, 0 is returned otherwise 1 | |
| * this function acquires a ticket even if ticket revocation is active */ | | * this function acquires a ticket even if ticket revocation is active */ | |
| int (*acquire_nonblocking)(xine_ticket_t *self, int irrevocable); | | int (*acquire_nonblocking)(xine_ticket_t *self, int irrevocable); | |
| | | | |
| /* behaves like release() but doesn't block the calling thread; should | | /* behaves like release() but doesn't block the calling thread; should | |
| * be used in combination with acquire_nonblocking() */ | | * be used in combination with acquire_nonblocking() */ | |
| void (*release_nonblocking)(xine_ticket_t *self, int irrevocable); | | void (*release_nonblocking)(xine_ticket_t *self, int irrevocable); | |
| | | | |
|
| | | int (*lock_port_rewiring)(xine_ticket_t *self, int ms_timeout); | |
| | | void (*unlock_port_rewiring)(xine_ticket_t *self); | |
| | | | |
| void (*dispose)(xine_ticket_t *self); | | void (*dispose)(xine_ticket_t *self); | |
| | | | |
| pthread_mutex_t lock; | | pthread_mutex_t lock; | |
| pthread_mutex_t revoke_lock; | | pthread_mutex_t revoke_lock; | |
| pthread_cond_t issued; | | pthread_cond_t issued; | |
| pthread_cond_t revoked; | | pthread_cond_t revoked; | |
| int tickets_granted; | | int tickets_granted; | |
| int irrevocable_tickets; | | int irrevocable_tickets; | |
| int pending_revocations; | | int pending_revocations; | |
| int atomic_revoke; | | int atomic_revoke; | |
| pthread_t atomic_revoker_thread; | | pthread_t atomic_revoker_thread; | |
|
| | | pthread_mutex_t port_rewiring_lock; | |
| struct { | | struct { | |
| int count; | | int count; | |
| pthread_t holder; | | pthread_t holder; | |
| } *holder_threads; | | } *holder_threads; | |
| unsigned holder_thread_count; | | unsigned holder_thread_count; | |
| #endif | | #endif | |
| }; | | }; | |
| | | | |
| /* | | /* | |
| * xine event queue | | * xine event queue | |
| */ | | */ | |
| | | | |
| struct xine_event_queue_s { | | struct xine_event_queue_s { | |
| xine_list_t *events; | | xine_list_t *events; | |
| pthread_mutex_t lock; | | pthread_mutex_t lock; | |
| pthread_cond_t new_event; | | pthread_cond_t new_event; | |
| pthread_cond_t events_processed; | | pthread_cond_t events_processed; | |
| xine_stream_t *stream; | | xine_stream_t *stream; | |
| pthread_t *listener_thread; | | pthread_t *listener_thread; | |
|
| | | void *user_data; | |
| xine_event_listener_cb_t callback; | | xine_event_listener_cb_t callback; | |
| int callback_running; | | int callback_running; | |
|
| void *user_data; | | | |
| }; | | }; | |
| | | | |
| /* | | /* | |
| * xine_stream - per-stream parts of the xine engine | | * xine_stream - per-stream parts of the xine engine | |
| */ | | */ | |
| | | | |
| struct xine_stream_s { | | struct xine_stream_s { | |
| | | | |
| /* reference to xine context */ | | /* reference to xine context */ | |
| xine_t *xine; | | xine_t *xine; | |
| | | | |
| /* metronom instance used by current stream */ | | /* metronom instance used by current stream */ | |
| metronom_t *metronom; | | metronom_t *metronom; | |
| | | | |
| /* demuxers use input_plugin to read data */ | | /* demuxers use input_plugin to read data */ | |
| input_plugin_t *input_plugin; | | input_plugin_t *input_plugin; | |
| | | | |
|
| /* current content detection method, see METHOD_BY_xxx */ | | | |
| int content_detection_method; | | | |
| | | | |
| /* used by video decoders */ | | /* used by video decoders */ | |
| xine_video_port_t *video_out; | | xine_video_port_t *video_out; | |
| | | | |
| /* demuxers send data to video decoders using this fifo */ | | /* demuxers send data to video decoders using this fifo */ | |
| fifo_buffer_t *video_fifo; | | fifo_buffer_t *video_fifo; | |
| | | | |
| /* used by audio decoders */ | | /* used by audio decoders */ | |
| xine_audio_port_t *audio_out; | | xine_audio_port_t *audio_out; | |
| | | | |
| /* demuxers send data to audio decoders using this fifo */ | | /* demuxers send data to audio decoders using this fifo */ | |
| | | | |
| skipping to change at line 256 | | skipping to change at line 250 | |
| vo_driver_t *video_driver; | | vo_driver_t *video_driver; | |
| | | | |
| /* these definitely should be made private! */ | | /* these definitely should be made private! */ | |
| int audio_channel_auto; | | int audio_channel_auto; | |
| int spu_decoder_streamtype; | | int spu_decoder_streamtype; | |
| int spu_channel_user; | | int spu_channel_user; | |
| int spu_channel_auto; | | int spu_channel_auto; | |
| int spu_channel_letterbox; | | int spu_channel_letterbox; | |
| int spu_channel; | | int spu_channel; | |
| | | | |
|
| | | /* current content detection method, see METHOD_BY_xxx */ | |
| | | int content_detection_method; | |
| | | | |
| #ifdef XINE_ENGINE_INTERNAL | | #ifdef XINE_ENGINE_INTERNAL | |
| /* these are private variables, plugins must not access them */ | | /* these are private variables, plugins must not access them */ | |
| | | | |
| int status; | | int status; | |
| | | | |
| /* lock controlling speed change access */ | | /* lock controlling speed change access */ | |
| pthread_mutex_t speed_change_lock; | | pthread_mutex_t speed_change_lock; | |
|
| int ignore_speed_change; /* speed changes during | | uint32_t ignore_speed_change:1; /*< speed changes duri | |
| stop can be disastrous */ | | ng stop can be disastrous */ | |
| | | uint32_t video_thread_created:1; | |
| | | uint32_t audio_thread_created:1; | |
| | | uint32_t first_frame_flag:2; | |
| | | uint32_t demux_action_pending:1; | |
| | | uint32_t demux_thread_created:1; | |
| | | uint32_t demux_thread_running:1; | |
| | | uint32_t slave_is_subtitle:1; /*< ... and will be au | |
| | | tomaticaly disposed */ | |
| | | uint32_t emergency_brake:1; /*< something went rea | |
| | | lly wrong and this stream must be | |
| | | * stopped. usually d | |
| | | ue some fatal error on output | |
| | | * layers as they can | |
| | | not call xine_stop. */ | |
| | | uint32_t early_finish_event:1; /*< do not wait fifos | |
| | | get empty before sending event */ | |
| | | uint32_t gapless_switch:1; /*< next stream switch | |
| | | will be gapless */ | |
| | | uint32_t keep_ao_driver_open:1; | |
| | | | |
| input_class_t *eject_class; | | input_class_t *eject_class; | |
| demux_plugin_t *demux_plugin; | | demux_plugin_t *demux_plugin; | |
| | | | |
| /* vo_driver_t *video_driver;*/ | | /* vo_driver_t *video_driver;*/ | |
| pthread_t video_thread; | | pthread_t video_thread; | |
|
| int video_thread_created; | | | |
| video_decoder_t *video_decoder_plugin; | | video_decoder_t *video_decoder_plugin; | |
|
| int video_decoder_streamtype; | | | |
| extra_info_t *video_decoder_extra_info; | | extra_info_t *video_decoder_extra_info; | |
|
| | | int video_decoder_streamtype; | |
| int video_channel; | | int video_channel; | |
| | | | |
|
| | | uint32_t audio_track_map[50]; | |
| | | int audio_track_map_entries; | |
| | | | |
| | | int audio_decoder_streamtype; | |
| pthread_t audio_thread; | | pthread_t audio_thread; | |
|
| int audio_thread_created; | | | |
| audio_decoder_t *audio_decoder_plugin; | | audio_decoder_t *audio_decoder_plugin; | |
|
| int audio_decoder_streamtype; | | | |
| extra_info_t *audio_decoder_extra_info; | | extra_info_t *audio_decoder_extra_info; | |
| | | | |
|
| uint32_t audio_track_map[50]; | | | |
| int audio_track_map_entries; | | | |
| uint32_t audio_type; | | uint32_t audio_type; | |
| /* *_user: -2 => off | | /* *_user: -2 => off | |
| -1 => auto (use *_auto value) | | -1 => auto (use *_auto value) | |
| >=0 => respect the user's choice | | >=0 => respect the user's choice | |
| */ | | */ | |
| int audio_channel_user; | | int audio_channel_user; | |
| /* int audio_channel_auto; */ | | /* int audio_channel_auto; */ | |
| | | | |
| /* spu_decoder_t *spu_decoder_plugin; */ | | /* spu_decoder_t *spu_decoder_plugin; */ | |
| /* int spu_decoder_streamtype; */ | | /* int spu_decoder_streamtype; */ | |
| | | | |
| skipping to change at line 315 | | skipping to change at line 324 | |
| /* stream meta information */ | | /* stream meta information */ | |
| /* NEVER access directly, use helpers (see info_helper.c) */ | | /* NEVER access directly, use helpers (see info_helper.c) */ | |
| pthread_mutex_t info_mutex; | | pthread_mutex_t info_mutex; | |
| int stream_info_public[XINE_STREAM_INFO_MAX]; | | int stream_info_public[XINE_STREAM_INFO_MAX]; | |
| int stream_info[XINE_STREAM_INFO_MAX]; | | int stream_info[XINE_STREAM_INFO_MAX]; | |
| pthread_mutex_t meta_mutex; | | pthread_mutex_t meta_mutex; | |
| char *meta_info_public[XINE_STREAM_INFO_MAX]; | | char *meta_info_public[XINE_STREAM_INFO_MAX]; | |
| char *meta_info[XINE_STREAM_INFO_MAX]; | | char *meta_info[XINE_STREAM_INFO_MAX]; | |
| | | | |
| /* seeking slowdown */ | | /* seeking slowdown */ | |
|
| int first_frame_flag; | | | |
| pthread_mutex_t first_frame_lock; | | pthread_mutex_t first_frame_lock; | |
| pthread_cond_t first_frame_reached; | | pthread_cond_t first_frame_reached; | |
| | | | |
| /* wait for headers sent / stream decoding finished */ | | /* wait for headers sent / stream decoding finished */ | |
| pthread_mutex_t counter_lock; | | pthread_mutex_t counter_lock; | |
| pthread_cond_t counter_changed; | | pthread_cond_t counter_changed; | |
| int header_count_audio; | | int header_count_audio; | |
| int header_count_video; | | int header_count_video; | |
| int finished_count_audio; | | int finished_count_audio; | |
| int finished_count_video; | | int finished_count_video; | |
| | | | |
| /* event mechanism */ | | /* event mechanism */ | |
| xine_list_t *event_queues; | | xine_list_t *event_queues; | |
| pthread_mutex_t event_queues_lock; | | pthread_mutex_t event_queues_lock; | |
| | | | |
| /* demux thread stuff */ | | /* demux thread stuff */ | |
| pthread_t demux_thread; | | pthread_t demux_thread; | |
|
| int demux_thread_created; | | | |
| int demux_thread_running; | | | |
| pthread_mutex_t demux_lock; | | pthread_mutex_t demux_lock; | |
|
| int demux_action_pending; | | pthread_mutex_t demux_action_lock; | |
| pthread_cond_t demux_resume; | | pthread_cond_t demux_resume; | |
| pthread_mutex_t demux_mutex; /* used in _x_demux_... functions
to synchronize order of pairwise A/V buffer operations */ | | pthread_mutex_t demux_mutex; /* used in _x_demux_... functions
to synchronize order of pairwise A/V buffer operations */ | |
| | | | |
| extra_info_t *current_extra_info; | | extra_info_t *current_extra_info; | |
| pthread_mutex_t current_extra_info_lock; | | pthread_mutex_t current_extra_info_lock; | |
| int video_seek_count; | | int video_seek_count; | |
| | | | |
|
| xine_post_out_t video_source; | | int delay_finish_event; /* delay event in 1/10 sec | |
| xine_post_out_t audio_source; | | units. 0=>no delay, -1=>forever */ | |
| | | | |
|
| int slave_is_subtitle; /* ... and will be automati
caly disposed */ | | | |
| int slave_affection; /* what operations need to
be propagated down to the slave? */ | | int slave_affection; /* what operations need to
be propagated down to the slave? */ | |
| | | | |
| int err; | | int err; | |
| | | | |
|
| | | xine_post_out_t video_source; | |
| | | xine_post_out_t audio_source; | |
| | | | |
| broadcaster_t *broadcaster; | | broadcaster_t *broadcaster; | |
| | | | |
| refcounter_t *refcounter; | | refcounter_t *refcounter; | |
|
| | | | |
| int emergency_brake; /* something went really wron | | | |
| g and this stream must be | | | |
| * stopped. usually due some | | | |
| fatal error on output | | | |
| * layers as they cannot call | | | |
| xine_stop. */ | | | |
| int early_finish_event; /* do not wait fifos get e | | | |
| mpty before sending event */ | | | |
| int gapless_switch; /* next stream switch will | | | |
| be gapless */ | | | |
| int delay_finish_event; /* delay event in 1/10 sec | | | |
| units. 0=>no delay, -1=>forever */ | | | |
| int keep_ao_driver_open; | | | |
| #endif | | #endif | |
| }; | | }; | |
| | | | |
| /* when explicitly noted, some functions accept an anonymous stream, | | /* when explicitly noted, some functions accept an anonymous stream, | |
| * which is a valid stream that does not want to be addressed. */ | | * which is a valid stream that does not want to be addressed. */ | |
| #define XINE_ANON_STREAM ((xine_stream_t *)-1) | | #define XINE_ANON_STREAM ((xine_stream_t *)-1) | |
| | | | |
|
| | | typedef struct | |
| | | { | |
| | | int total; | |
| | | int ready; | |
| | | int avail; | |
| | | } | |
| | | xine_query_buffers_data_t; | |
| | | | |
| | | typedef struct | |
| | | { | |
| | | xine_query_buffers_data_t vi; | |
| | | xine_query_buffers_data_t ai; | |
| | | xine_query_buffers_data_t vo; | |
| | | xine_query_buffers_data_t ao; | |
| | | } | |
| | | xine_query_buffers_t; | |
| | | | |
| /* | | /* | |
| * private function prototypes: | | * private function prototypes: | |
| */ | | */ | |
| | | | |
|
| | | int _x_query_buffers(xine_stream_t *stream, xine_query_buffers_t *query) XI
NE_PROTECTED; | |
| int _x_query_buffer_usage(xine_stream_t *stream, int *num_video_buffers, in
t *num_audio_buffers, int *num_video_frames, int *num_audio_frames) XINE_PR
OTECTED; | | int _x_query_buffer_usage(xine_stream_t *stream, int *num_video_buffers, in
t *num_audio_buffers, int *num_video_frames, int *num_audio_frames) XINE_PR
OTECTED; | |
|
| | | int _x_lock_port_rewiring(xine_t *xine, int ms_to_time_out) XINE_PROTECTED; | |
| | | void _x_unlock_port_rewiring(xine_t *xine) XINE_PROTECTED; | |
| | | int _x_lock_frontend(xine_stream_t *stream, int ms_to_time_out) XINE_PROTEC | |
| | | TED; | |
| | | void _x_unlock_frontend(xine_stream_t *stream) XINE_PROTECTED; | |
| | | int _x_query_unprocessed_osd_events(xine_stream_t *stream) XINE_PROTECTED; | |
| | | int _x_demux_seek(xine_stream_t *stream, off_t start_pos, int start_time, i | |
| | | nt playing) XINE_PROTECTED; | |
| | | int _x_continue_stream_processing(xine_stream_t *stream) XINE_PROTECTED; | |
| | | void _x_trigger_relaxed_frame_drop_mode(xine_stream_t *stream) XINE_PROTECT | |
| | | ED; | |
| | | void _x_reset_relaxed_frame_drop_mode(xine_stream_t *stream) XINE_PROTECTED | |
| | | ; | |
| | | | |
| void _x_handle_stream_end (xine_stream_t *stream, int non_user) XINE_P
ROTECTED; | | void _x_handle_stream_end (xine_stream_t *stream, int non_user) XINE_P
ROTECTED; | |
| | | | |
| /* report message to UI. usually these are async errors */ | | /* report message to UI. usually these are async errors */ | |
| | | | |
| int _x_message(xine_stream_t *stream, int type, ...) XINE_SENTINEL XINE_PRO
TECTED; | | int _x_message(xine_stream_t *stream, int type, ...) XINE_SENTINEL XINE_PRO
TECTED; | |
| | | | |
| /* flush the message queues */ | | /* flush the message queues */ | |
| | | | |
| void _x_flush_events_queues (xine_stream_t *stream) XINE_PROTECTED; | | void _x_flush_events_queues (xine_stream_t *stream) XINE_PROTECTED; | |
| | | | |
|
| /* find and instantiate input and demux plugins */ | | | |
| | | | |
| input_plugin_t *_x_find_input_plugin (xine_stream_t *stream, const char *mr | | | |
| l) XINE_PROTECTED; | | | |
| demux_plugin_t *_x_find_demux_plugin (xine_stream_t *stream, input_plugin_t | | | |
| *input) XINE_PROTECTED; | | | |
| demux_plugin_t *_x_find_demux_plugin_by_name (xine_stream_t *stream, const | | | |
| char *name, input_plugin_t *input) XINE_PROTECTED; | | | |
| demux_plugin_t *_x_find_demux_plugin_last_probe(xine_stream_t *stream, cons | | | |
| t char *last_demux_name, input_plugin_t *input) XINE_PROTECTED; | | | |
| input_plugin_t *_x_rip_plugin_get_instance (xine_stream_t *stream, const ch | | | |
| ar *filename) XINE_MALLOC XINE_PROTECTED; | | | |
| input_plugin_t *_x_cache_plugin_get_instance (xine_stream_t *stream, int re | | | |
| adahead_size) XINE_MALLOC XINE_PROTECTED; | | | |
| void _x_free_input_plugin (xine_stream_t *stream, input_plugin_t *input) XI | | | |
| NE_PROTECTED; | | | |
| void _x_free_demux_plugin (xine_stream_t *stream, demux_plugin_t *demux) XI | | | |
| NE_PROTECTED; | | | |
| | | | |
| /* create decoder fifos and threads */ | | | |
| | | | |
| int _x_video_decoder_init (xine_stream_t *stream) XINE_PROTECTED; | | | |
| void _x_video_decoder_shutdown (xine_stream_t *stream) XINE_PROTECTED; | | | |
| | | | |
| int _x_audio_decoder_init (xine_stream_t *stream) XINE_PROTECTED; | | | |
| void _x_audio_decoder_shutdown (xine_stream_t *stream) XINE_PROTECTED; | | | |
| | | | |
| /* extra_info operations */ | | /* extra_info operations */ | |
| void _x_extra_info_reset( extra_info_t *extra_info ) XINE_PROTECTED; | | void _x_extra_info_reset( extra_info_t *extra_info ) XINE_PROTECTED; | |
| | | | |
| void _x_extra_info_merge( extra_info_t *dst, extra_info_t *src ) XINE_PROTE
CTED; | | void _x_extra_info_merge( extra_info_t *dst, extra_info_t *src ) XINE_PROTE
CTED; | |
| | | | |
| void _x_get_current_info (xine_stream_t *stream, extra_info_t *extra_info,
int size) XINE_PROTECTED; | | void _x_get_current_info (xine_stream_t *stream, extra_info_t *extra_info,
int size) XINE_PROTECTED; | |
| | | | |
| /* demuxer helper functions from demux.c */ | | /* demuxer helper functions from demux.c */ | |
| | | | |
| /* | | /* | |
| | | | |
| skipping to change at line 432 | | skipping to change at line 439 | |
| */ | | */ | |
| void _x_demux_flush_engine (xine_stream_t *stream) XINE_PROTECTED; | | void _x_demux_flush_engine (xine_stream_t *stream) XINE_PROTECTED; | |
| | | | |
| void _x_demux_control_nop (xine_stream_t *stream, uint32_t flags)
XINE_PROTECTED; | | void _x_demux_control_nop (xine_stream_t *stream, uint32_t flags)
XINE_PROTECTED; | |
| void _x_demux_control_newpts (xine_stream_t *stream, int64_t pts, uin
t32_t flags) XINE_PROTECTED; | | void _x_demux_control_newpts (xine_stream_t *stream, int64_t pts, uin
t32_t flags) XINE_PROTECTED; | |
| void _x_demux_control_headers_done (xine_stream_t *stream) XINE_PROTECTED; | | void _x_demux_control_headers_done (xine_stream_t *stream) XINE_PROTECTED; | |
| void _x_demux_control_start (xine_stream_t *stream) XINE_PROTECTED; | | void _x_demux_control_start (xine_stream_t *stream) XINE_PROTECTED; | |
| void _x_demux_control_end (xine_stream_t *stream, uint32_t flags)
XINE_PROTECTED; | | void _x_demux_control_end (xine_stream_t *stream, uint32_t flags)
XINE_PROTECTED; | |
| int _x_demux_start_thread (xine_stream_t *stream) XINE_PROTECTED; | | int _x_demux_start_thread (xine_stream_t *stream) XINE_PROTECTED; | |
| int _x_demux_stop_thread (xine_stream_t *stream) XINE_PROTECTED; | | int _x_demux_stop_thread (xine_stream_t *stream) XINE_PROTECTED; | |
|
| int _x_demux_read_header (input_plugin_t *input, unsigned char *b | | int _x_demux_read_header (input_plugin_t *input, void *buffer, of | |
| uffer, off_t size) XINE_PROTECTED; | | f_t size) XINE_PROTECTED; | |
| int _x_demux_check_extension (const char *mrl, const char *extensions | | int _x_demux_check_extension (const char *mrl, const char *extensions | |
| ) XINE_PROTECTED; | | ); | |
| | | | |
| off_t _x_read_abort (xine_stream_t *stream, int fd, char *buf, off_t todo)
XINE_PROTECTED; | | off_t _x_read_abort (xine_stream_t *stream, int fd, char *buf, off_t todo)
XINE_PROTECTED; | |
| | | | |
| int _x_action_pending (xine_stream_t *stream) XINE_PROTECTED; | | int _x_action_pending (xine_stream_t *stream) XINE_PROTECTED; | |
| | | | |
|
| | | void _x_action_raise (xine_stream_t *stream) XINE_PROTECTED; | |
| | | void _x_action_lower (xine_stream_t *stream) XINE_PROTECTED; | |
| | | | |
| void _x_demux_send_data(fifo_buffer_t *fifo, uint8_t *data, int size, | | void _x_demux_send_data(fifo_buffer_t *fifo, uint8_t *data, int size, | |
| int64_t pts, uint32_t type, uint32_t decoder_flags, | | int64_t pts, uint32_t type, uint32_t decoder_flags, | |
| int input_normpos, int input_time, int total_time, | | int input_normpos, int input_time, int total_time, | |
| uint32_t frame_number) XINE_PROTECTED; | | uint32_t frame_number) XINE_PROTECTED; | |
| | | | |
| int _x_demux_read_send_data(fifo_buffer_t *fifo, input_plugin_t *input, | | int _x_demux_read_send_data(fifo_buffer_t *fifo, input_plugin_t *input, | |
| int size, int64_t pts, uint32_t type, | | int size, int64_t pts, uint32_t type, | |
| uint32_t decoder_flags, off_t input_normpos, | | uint32_t decoder_flags, off_t input_normpos, | |
| int input_time, int total_time, | | int input_time, int total_time, | |
| uint32_t frame_number) XINE_PROTECTED; | | uint32_t frame_number) XINE_PROTECTED; | |
| | | | |
End of changes. 33 change blocks. |
| 105 lines changed or deleted | | 112 lines changed or added | |
|
| xineutils.h | | xineutils.h | |
| | | | |
| skipping to change at line 32 | | skipping to change at line 32 | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| extern "C" { | | extern "C" { | |
| #endif | | #endif | |
| | | | |
| #include <stdlib.h> | | #include <stdlib.h> | |
| #include <string.h> | | #include <string.h> | |
| #include <stdarg.h> | | #include <stdarg.h> | |
| #include <pthread.h> | | #include <pthread.h> | |
| | | | |
|
| #ifdef XINE_COMPILE | | #ifdef WIN32 | |
| # include <inttypes.h> | | # include <winsock.h> | |
| # include "attributes.h" | | | |
| # include "compat.h" | | | |
| # include "xmlparser.h" | | | |
| # include "xine_buffer.h" | | | |
| # include "configfile.h" | | | |
| # include "list.h" | | | |
| # include "array.h" | | | |
| # include "sorted_array.h" | | | |
| # include "xine_mmx.h" | | | |
| #else | | #else | |
|
| # ifdef WIN32 | | # include <sys/time.h> | |
| # include <winsock.h> | | | |
| # else | | | |
| # include <sys/time.h> | | | |
| # endif | | | |
| # include <xine/os_types.h> | | | |
| # include <xine/attributes.h> | | | |
| # include <xine/compat.h> | | | |
| # include <xine/xmlparser.h> | | | |
| # include <xine/xine_buffer.h> | | | |
| # include <xine/configfile.h> | | | |
| # include <xine/list.h> | | | |
| # include <xine/array.h> | | | |
| # include <xine/sorted_array.h> | | | |
| # include <xine/xine_mmx.h> | | | |
| #endif | | #endif | |
|
| | | #include <xine/os_types.h> | |
| | | #include <xine/attributes.h> | |
| | | #include <xine/compat.h> | |
| | | #include <xine/xmlparser.h> | |
| | | #include <xine/xine_buffer.h> | |
| | | #include <xine/configfile.h> | |
| | | #include <xine/list.h> | |
| | | #include <xine/array.h> | |
| | | #include <xine/sorted_array.h> | |
| | | | |
| #include <stdio.h> | | #include <stdio.h> | |
| #include <string.h> | | #include <string.h> | |
| | | | |
| /* | | /* | |
| * Mark exported data symbols for link engine library clients with older | | * Mark exported data symbols for link engine library clients with older | |
| * Win32 compilers | | * Win32 compilers | |
| */ | | */ | |
| #if defined(WIN32) && !defined(XINE_LIBRARY_COMPILE) | | #if defined(WIN32) && !defined(XINE_LIBRARY_COMPILE) | |
| # define DL_IMPORT __declspec(dllimport) | | # define DL_IMPORT __declspec(dllimport) | |
| | | | |
| skipping to change at line 130 | | skipping to change at line 116 | |
| #define MM_MMXEXT MM_ACCEL_X86_MMXEXT | | #define MM_MMXEXT MM_ACCEL_X86_MMXEXT | |
| #define MM_SSE MM_ACCEL_X86_SSE | | #define MM_SSE MM_ACCEL_X86_SSE | |
| #define MM_SSE2 MM_ACCEL_X86_SSE2 | | #define MM_SSE2 MM_ACCEL_X86_SSE2 | |
| | | | |
| uint32_t xine_mm_accel (void) XINE_CONST XINE_PROTECTED; | | uint32_t xine_mm_accel (void) XINE_CONST XINE_PROTECTED; | |
| | | | |
| /* Optimized/fast memcpy */ | | /* Optimized/fast memcpy */ | |
| | | | |
| extern void *(* xine_fast_memcpy)(void *to, const void *from, size_t len) X
INE_PROTECTED; | | extern void *(* xine_fast_memcpy)(void *to, const void *from, size_t len) X
INE_PROTECTED; | |
| | | | |
|
| #ifdef HAVE_XINE_INTERNAL_H | | | |
| /* Benchmark available memcpy methods */ | | | |
| void xine_probe_fast_memcpy(xine_t *xine) XINE_PROTECTED; | | | |
| #endif | | | |
| | | | |
| /* | | /* | |
| * Debug stuff | | * Debug stuff | |
| */ | | */ | |
| /* | | /* | |
| * profiling (unworkable in non DEBUG isn't defined) | | * profiling (unworkable in non DEBUG isn't defined) | |
| */ | | */ | |
| void xine_profiler_init (void) XINE_PROTECTED; | | void xine_profiler_init (void) XINE_PROTECTED; | |
| int xine_profiler_allocate_slot (const char *label) XINE_PROTECTED; | | int xine_profiler_allocate_slot (const char *label) XINE_PROTECTED; | |
| void xine_profiler_start_count (int id) XINE_PROTECTED; | | void xine_profiler_start_count (int id) XINE_PROTECTED; | |
| void xine_profiler_stop_count (int id) XINE_PROTECTED; | | void xine_profiler_stop_count (int id) XINE_PROTECTED; | |
| void xine_profiler_print_results (void) XINE_PROTECTED; | | void xine_profiler_print_results (void) XINE_PROTECTED; | |
| | | | |
| /* | | /* | |
| * Allocate and clean memory size_t 'size', then return the pointer | | * Allocate and clean memory size_t 'size', then return the pointer | |
| * to the allocated memory. | | * to the allocated memory. | |
| */ | | */ | |
| void *xine_xmalloc(size_t size) XINE_MALLOC XINE_DEPRECATED XINE_PROTECTED; | | void *xine_xmalloc(size_t size) XINE_MALLOC XINE_DEPRECATED XINE_PROTECTED; | |
| | | | |
|
| | | void *xine_xcalloc(size_t nmemb, size_t size) XINE_MALLOC XINE_PROTECTED; | |
| | | | |
| /* | | /* | |
|
| * Same as above, but memory is aligned to 'alignement'. | | * Copy blocks of memory. | |
| * **base is used to return pointer to un-aligned memory, use | | | |
| * this to free the mem chunk | | | |
| */ | | */ | |
|
| void *xine_xmalloc_aligned(size_t alignment, size_t size, void **base) XINE | | void *xine_memdup (const void *src, size_t length) XINE_MALLOC XINE_PROTECT | |
| _PROTECTED; | | ED; | |
| | | void *xine_memdup0 (const void *src, size_t length) XINE_MALLOC XINE_PROTEC | |
| | | TED; | |
| | | | |
| /* | | /* | |
| * Get user home directory. | | * Get user home directory. | |
| */ | | */ | |
| const char *xine_get_homedir(void) XINE_PROTECTED; | | const char *xine_get_homedir(void) XINE_PROTECTED; | |
| | | | |
| #if defined(WIN32) || defined(__CYGWIN__) | | #if defined(WIN32) || defined(__CYGWIN__) | |
| /* | | /* | |
| * Get other xine directories. | | * Get other xine directories. | |
| */ | | */ | |
| | | | |
| skipping to change at line 186 | | skipping to change at line 168 | |
| * Clean a string (remove spaces and '=' at the begin, | | * Clean a string (remove spaces and '=' at the begin, | |
| * and '\n', '\r' and spaces at the end. | | * and '\n', '\r' and spaces at the end. | |
| */ | | */ | |
| char *xine_chomp (char *str) XINE_PROTECTED; | | char *xine_chomp (char *str) XINE_PROTECTED; | |
| | | | |
| /* | | /* | |
| * A thread-safe usecond sleep | | * A thread-safe usecond sleep | |
| */ | | */ | |
| void xine_usec_sleep(unsigned usec) XINE_PROTECTED; | | void xine_usec_sleep(unsigned usec) XINE_PROTECTED; | |
| | | | |
|
| /* | | | |
| * Some string functions | | | |
| */ | | | |
| | | | |
| void xine_strdupa(char *dest, char *src) XINE_PROTECTED XINE_DEPRECATED; | | | |
| #define xine_strdupa(d, s) do { | | | |
| \ | | | |
| (d) = NULL; | | | |
| \ | | | |
| if((s) != NULL) { | | | |
| \ | | | |
| (d) = (char *) alloca(strlen((s)) + 1); | | | |
| \ | | | |
| strcpy((d), (s)); | | | |
| \ | | | |
| } | | | |
| \ | | | |
| } while(0) | | | |
| | | | |
| /* compatibility macros */ | | /* compatibility macros */ | |
| #define xine_strpbrk(S, ACCEPT) strpbrk((S), (ACCEPT)) | | #define xine_strpbrk(S, ACCEPT) strpbrk((S), (ACCEPT)) | |
| #define xine_strsep(STRINGP, DELIM) strsep((STRINGP), (DELIM)) | | #define xine_strsep(STRINGP, DELIM) strsep((STRINGP), (DELIM)) | |
| #define xine_setenv(NAME, VAL, XX) setenv((NAME), (VAL), (XX)) | | #define xine_setenv(NAME, VAL, XX) setenv((NAME), (VAL), (XX)) | |
| | | | |
| /** | | /** | |
| * append to a string, reallocating | | * append to a string, reallocating | |
| * normally, updates & returns *dest | | * normally, updates & returns *dest | |
| * on error, *dest is unchanged & NULL is returned. | | * on error, *dest is unchanged & NULL is returned. | |
| */ | | */ | |
| | | | |
| skipping to change at line 341 | | skipping to change at line 310 | |
| (const unsigned char *y_src, int y_src_pitch, unsigned char *y_dst, int y
_dst_pitch, | | (const unsigned char *y_src, int y_src_pitch, unsigned char *y_dst, int y
_dst_pitch, | |
| const unsigned char *u_src, int u_src_pitch, unsigned char *u_dst, int u
_dst_pitch, | | const unsigned char *u_src, int u_src_pitch, unsigned char *u_dst, int u
_dst_pitch, | |
| const unsigned char *v_src, int v_src_pitch, unsigned char *v_dst, int v
_dst_pitch, | | const unsigned char *v_src, int v_src_pitch, unsigned char *v_dst, int v
_dst_pitch, | |
| int width, int height) XINE_PROTECTED; | | int width, int height) XINE_PROTECTED; | |
| extern void yuy2_to_yuy2 | | extern void yuy2_to_yuy2 | |
| (const unsigned char *src, int src_pitch, | | (const unsigned char *src, int src_pitch, | |
| unsigned char *dst, int dst_pitch, | | unsigned char *dst, int dst_pitch, | |
| int width, int height) XINE_PROTECTED; | | int width, int height) XINE_PROTECTED; | |
| | | | |
| /* print a hexdump of the given data */ | | /* print a hexdump of the given data */ | |
|
| void xine_hexdump (const char *buf, int length) XINE_PROTECTED; | | void xine_hexdump (const void *buf, int length) XINE_PROTECTED; | |
| | | | |
| /* | | /* | |
| * Optimization macros for conditions | | * Optimization macros for conditions | |
| * Taken from the FIASCO L4 microkernel sources | | * Taken from the FIASCO L4 microkernel sources | |
| */ | | */ | |
| #if !defined(__GNUC__) || __GNUC__ < 3 | | #if !defined(__GNUC__) || __GNUC__ < 3 | |
| # define EXPECT_TRUE(x) (x) | | # define EXPECT_TRUE(x) (x) | |
| # define EXPECT_FALSE(x) (x) | | # define EXPECT_FALSE(x) (x) | |
| #else | | #else | |
| # define EXPECT_TRUE(x) __builtin_expect((x),1) | | # define EXPECT_TRUE(x) __builtin_expect((x),1) | |
| | | | |
| skipping to change at line 529 | | skipping to change at line 498 | |
| * guess default encoding for the subtitles | | * guess default encoding for the subtitles | |
| */ | | */ | |
| const char *xine_guess_spu_encoding(void) XINE_PROTECTED; | | const char *xine_guess_spu_encoding(void) XINE_PROTECTED; | |
| | | | |
| /* | | /* | |
| * use the best clock reference (API compatible with gettimeofday) | | * use the best clock reference (API compatible with gettimeofday) | |
| * note: it will be a monotonic clock, if available. | | * note: it will be a monotonic clock, if available. | |
| */ | | */ | |
| int xine_monotonic_clock(struct timeval *tv, struct timezone *tz) XINE_PROT
ECTED; | | int xine_monotonic_clock(struct timeval *tv, struct timezone *tz) XINE_PROT
ECTED; | |
| | | | |
|
| | | /** | |
| | | * Unknown FourCC reporting functions | |
| | | */ | |
| | | void _x_report_video_fourcc (xine_t *, const char *module, uint32_t) XINE_P | |
| | | ROTECTED; | |
| | | void _x_report_audio_format_tag (xine_t *, const char *module, uint32_t) XI | |
| | | NE_PROTECTED; | |
| | | | |
| /* don't harm following code */ | | /* don't harm following code */ | |
| #ifdef extern | | #ifdef extern | |
| # undef extern | | # undef extern | |
| #endif | | #endif | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| } | | } | |
| #endif | | #endif | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 10 change blocks. |
| 56 lines changed or deleted | | 28 lines changed or added | |
|