tests/sched/Makefile
tests/eos/Makefile
testsuite/Makefile
+testsuite/capsnego/Makefile
tests/nego/Makefile
examples/Makefile
examples/autoplug/Makefile
@buf:
@rgb:
-<!-- ##### SECTION ./tmpl/jdw.sgml:See_Also ##### -->
-<para>
-
-</para>
-
-
<!-- ##### STRUCT Mpeg1Meta ##### -->
<para>
@ES_rate:
@trick_mode_control:
+<!-- ##### SECTION ./tmpl/jdw.sgml:See_Also ##### -->
+<para>
+
+</para>
+
+
<!-- ##### MACRO LITTLE_SHORT16 ##### -->
<para>
</para>
+<!-- ##### SECTION ./tmpl/uncouple.sgml:Title ##### -->
+uncouple
+
+
<!-- ##### MACRO GST_PARSEAVI_REGULAR ##### -->
<para>
</para>
-<!-- ##### SECTION ./tmpl/uncouple.sgml:Title ##### -->
-uncouple
-
-
<!-- ##### SECTION ./tmpl/system.sgml:Long_Description ##### -->
<para>
</para>
-<!-- ##### MACRO MAX_FLIP_BUFFERS ##### -->
+<!-- ##### SECTION ./tmpl/RTjpeg.sgml:See_Also ##### -->
<para>
</para>
-<!-- ##### SECTION ./tmpl/RTjpeg.sgml:See_Also ##### -->
+<!-- ##### MACRO MAX_FLIP_BUFFERS ##### -->
<para>
</para>
</para>
-<!-- ##### FUNCTION rb_end_write ##### -->
+<!-- ##### FUNCTION EncodeAC ##### -->
<para>
</para>
+@vid_stream:
+@index:
+@matrix:
-<!-- ##### FUNCTION EncodeAC ##### -->
+<!-- ##### FUNCTION rb_end_write ##### -->
<para>
</para>
-@vid_stream:
-@index:
-@matrix:
<!-- ##### FUNCTION ReferenceIDct ##### -->
<para>
</para>
-<!-- ##### MACRO NEW_DATA ##### -->
+<!-- ##### ARG GstMpeg2play:frames_per_second ##### -->
<para>
</para>
-<!-- ##### ARG GstMpeg2play:frames_per_second ##### -->
+<!-- ##### MACRO NEW_DATA ##### -->
<para>
</para>
</para>
-<!-- ##### MACRO SC_NONE ##### -->
+<!-- ##### FUNCTION gst_vumeter_new ##### -->
<para>
</para>
+@name:
+@Returns:
-<!-- ##### FUNCTION gst_vumeter_new ##### -->
+<!-- ##### MACRO SC_NONE ##### -->
<para>
</para>
-@name:
-@Returns:
<!-- ##### FUNCTION mpeg2enc_new_encoder ##### -->
<para>
</para>
-<!-- ##### FUNCTION mpg123_get_songlen ##### -->
-<para>
-
-</para>
+<!-- ##### SECTION ./tmpl/acconfig.sgml:Title ##### -->
+acconfig
-@fr:
-@no:
-@Returns:
<!-- ##### MACRO sputv ##### -->
<para>
</para>
-<!-- ##### SECTION ./tmpl/acconfig.sgml:Title ##### -->
-acconfig
+<!-- ##### FUNCTION mpg123_get_songlen ##### -->
+<para>
+
+</para>
+@fr:
+@no:
+@Returns:
<!-- ##### ARG System_Encode:video ##### -->
<para>
</para>
-<!-- ##### SECTION ./tmpl/mpg123.sgml:Long_Description ##### -->
+<!-- ##### SECTION ./tmpl/system.sgml:See_Also ##### -->
<para>
</para>
-<!-- ##### SECTION ./tmpl/system.sgml:See_Also ##### -->
+<!-- ##### SECTION ./tmpl/mpg123.sgml:Long_Description ##### -->
<para>
</para>
</para>
-<!-- ##### MACRO MACRO_BLOCK_ESCAPE ##### -->
+<!-- ##### SECTION ./tmpl/globals.sgml:Long_Description ##### -->
<para>
</para>
-<!-- ##### SECTION ./tmpl/globals.sgml:Long_Description ##### -->
+<!-- ##### MACRO MACRO_BLOCK_ESCAPE ##### -->
<para>
</para>
</para>
-<!-- ##### FUNCTION ac3dec_imdct_init ##### -->
+<!-- ##### ARG GstV4lSrc:mode ##### -->
<para>
</para>
</para>
-<!-- ##### ARG GstV4lSrc:mode ##### -->
+<!-- ##### FUNCTION ac3dec_imdct_init ##### -->
<para>
</para>
debug
-<!-- ##### TYPEDEF motion_vectors_entry ##### -->
-<para>
+<!-- ##### SECTION ./tmpl/prototypes.sgml:Short_Description ##### -->
-</para>
-<!-- ##### SECTION ./tmpl/prototypes.sgml:Short_Description ##### -->
+<!-- ##### TYPEDEF motion_vectors_entry ##### -->
+<para>
+</para>
<!-- ##### STRUCT GstRiffChunk ##### -->
@obj:
+<!-- ##### SECTION ./tmpl/htable.sgml:Title ##### -->
+htable
+
+
<!-- ##### FUNCTION putbits_new_empty_buffer ##### -->
<para>
@pb:
@len:
-<!-- ##### SECTION ./tmpl/htable.sgml:Title ##### -->
-htable
-
-
-<!-- ##### FUNCTION RTjpeg_decompress8 ##### -->
+<!-- ##### MACRO ERROR_MARKER_STRUCTURE ##### -->
<para>
</para>
-@sp:
-@bp:
-<!-- ##### MACRO ERROR_MARKER_STRUCTURE ##### -->
+<!-- ##### FUNCTION RTjpeg_decompress8 ##### -->
<para>
</para>
+@sp:
+@bp:
<!-- ##### FUNCTION JP0HDecimateMem ##### -->
<para>
@Returns:
-<!-- ##### MACRO ISO_END_CODE ##### -->
+<!-- ##### MACRO MB_FORWARD ##### -->
<para>
</para>
-<!-- ##### MACRO MB_FORWARD ##### -->
+<!-- ##### MACRO ISO_END_CODE ##### -->
<para>
</para>
-<!-- ##### FUNCTION ReadVSHeader ##### -->
+<!-- ##### SECTION ./tmpl/acconfig.sgml:Long_Description ##### -->
<para>
</para>
-@vid_stream:
-@Returns:
<!-- ##### SECTION ./tmpl/bitstream.sgml:Short_Description ##### -->
-<!-- ##### SECTION ./tmpl/acconfig.sgml:Long_Description ##### -->
+<!-- ##### FUNCTION ReadVSHeader ##### -->
<para>
</para>
+@vid_stream:
+@Returns:
<!-- ##### MACRO SYNA_SIZE ##### -->
<para>
</para>
-<!-- ##### MACRO GRAB_ATTR_VOLUME ##### -->
+<!-- ##### MACRO SBLIMIT ##### -->
<para>
</para>
-<!-- ##### MACRO SBLIMIT ##### -->
+<!-- ##### MACRO GRAB_ATTR_VOLUME ##### -->
<para>
</para>
@hi:
@str:
-<!-- ##### SECTION ./tmpl/musicin.sgml:Title ##### -->
-musicin
-
-
<!-- ##### FUNCTION BruteMotionEstimation ##### -->
<para>
@pmem:
@fmem:
+<!-- ##### SECTION ./tmpl/musicin.sgml:Title ##### -->
+musicin
+
+
<!-- ##### MACRO PICTURE_LAYER ##### -->
<para>
@Returns:
-<!-- ##### MACRO MakeStructure ##### -->
+<!-- ##### MACRO DecodeCBP ##### -->
<para>
</para>
-@named_st:
+@gb:
+@coded_bp:
-<!-- ##### MACRO DecodeCBP ##### -->
+<!-- ##### MACRO MakeStructure ##### -->
<para>
</para>
-@gb:
-@coded_bp:
+@named_st:
-<!-- ##### MACRO L_SQUANT ##### -->
+<!-- ##### TYPEDEF D10[10] ##### -->
<para>
</para>
-<!-- ##### TYPEDEF D10[10] ##### -->
+<!-- ##### MACRO L_SQUANT ##### -->
<para>
</para>
@gstvideosink: the object which received the signal.
@arg1:
+<!-- ##### FUNCTION putbits_new_buffer ##### -->
+<para>
+
+</para>
+
+@pb:
+@buffer:
+@len:
+
<!-- ##### MACRO SLICE_MIN_START_CODE ##### -->
<para>
</para>
-<!-- ##### FUNCTION putbits_new_buffer ##### -->
+<!-- ##### TYPEDEF BLOCK ##### -->
<para>
</para>
-@pb:
-@buffer:
-@len:
<!-- ##### FUNCTION HPFastBME ##### -->
<para>
@ox:
@oy:
-<!-- ##### TYPEDEF BLOCK ##### -->
-<para>
-
-</para>
-
-
-<!-- ##### MACRO GTK_OVERLAY_IMAGE_MEM ##### -->
+<!-- ##### FUNCTION parse_auxdata ##### -->
<para>
</para>
-@obj:
+@syncinfo:
+@gb:
<!-- ##### FUNCTION Decode ##### -->
<para>
@huff:
@Returns:
-<!-- ##### FUNCTION parse_auxdata ##### -->
+<!-- ##### MACRO GTK_OVERLAY_IMAGE_MEM ##### -->
<para>
</para>
-@syncinfo:
-@gb:
+@obj:
<!-- ##### MACRO FADE_HEAT ##### -->
<para>
-<!-- ##### MACRO WHEREAMI ##### -->
+<!-- ##### ARG Mpeg2Parse:mux_rate ##### -->
<para>
</para>
-<!-- ##### ARG Mpeg2Parse:mux_rate ##### -->
+<!-- ##### MACRO WHEREAMI ##### -->
<para>
</para>
</para>
-<!-- ##### SECTION ./tmpl/video.sgml:Title ##### -->
-video
-
-
<!-- ##### SECTION ./tmpl/proto.sgml:Long_Description ##### -->
<para>
</para>
+<!-- ##### SECTION ./tmpl/video.sgml:Title ##### -->
+video
+
+
<!-- ##### FUNCTION TransposeMatrix ##### -->
<para>
</para>
-<!-- ##### MACRO FUTURE_LOCK ##### -->
-<para>
+<!-- ##### SECTION ./tmpl/gtkoverlayimage.sgml:Short_Description ##### -->
-</para>
-<!-- ##### TYPEDEF DCTELEM ##### -->
+<!-- ##### MACRO SLICE_LAYER ##### -->
<para>
</para>
-<!-- ##### MACRO SLICE_LAYER ##### -->
+<!-- ##### TYPEDEF DCTELEM ##### -->
<para>
</para>
-<!-- ##### SECTION ./tmpl/gtkoverlayimage.sgml:Short_Description ##### -->
+<!-- ##### MACRO FUTURE_LOCK ##### -->
+<para>
+</para>
-<!-- ##### SECTION ./tmpl/gstriff.sgml:Short_Description ##### -->
+<!-- ##### MACRO P_DCINTRA ##### -->
+<para>
+</para>
<!-- ##### FUNCTION crc_init ##### -->
</para>
-<!-- ##### MACRO P_DCINTRA ##### -->
-<para>
+<!-- ##### SECTION ./tmpl/gstriff.sgml:Short_Description ##### -->
-</para>
<!-- ##### FUNCTION gst_v4lsrc_push ##### -->
</para>
-<!-- ##### FUNCTION MakeFGroup ##### -->
+<!-- ##### FUNCTION MakeImage ##### -->
<para>
</para>
@vid_stream:
-<!-- ##### FUNCTION MakeImage ##### -->
+<!-- ##### FUNCTION MakeFGroup ##### -->
<para>
</para>
</para>
-<!-- ##### FUNCTION SaveMem ##### -->
+<!-- ##### FUNCTION gst_riff_get_chunk ##### -->
<para>
</para>
-@filename:
-@mem:
+@riff:
+@fourcc:
@Returns:
-<!-- ##### FUNCTION gst_riff_get_chunk ##### -->
+<!-- ##### FUNCTION SaveMem ##### -->
<para>
</para>
-@riff:
-@fourcc:
+@filename:
+@mem:
@Returns:
<!-- ##### MACRO L_BUFFERSIZE ##### -->
</para>
-<!-- ##### MACRO NOISY ##### -->
+<!-- ##### FUNCTION bitstream_get ##### -->
<para>
</para>
+@bs:
+@num_bits:
+@Returns:
-<!-- ##### FUNCTION bitstream_get ##### -->
+<!-- ##### MACRO NOISY ##### -->
<para>
</para>
-@bs:
-@num_bits:
-@Returns:
<!-- ##### MACRO MINIMUM ##### -->
<para>
</para>
-<!-- ##### MACRO PACK_START_CODE ##### -->
-<para>
-
-</para>
-
-
<!-- ##### FUNCTION gst_mpegaudio_chain ##### -->
<para>
@pad:
@buf:
-<!-- ##### TYPEDEF DFFT2[FFT_SIZE/2] ##### -->
+<!-- ##### MACRO PACK_START_CODE ##### -->
<para>
</para>
-<!-- ##### SECTION ./tmpl/buffer.sgml:Short_Description ##### -->
+<!-- ##### TYPEDEF DFFT2[FFT_SIZE/2] ##### -->
+<para>
+</para>
<!-- ##### MACRO SYS_HEADER_LENGTH ##### -->
</para>
+<!-- ##### SECTION ./tmpl/buffer.sgml:Short_Description ##### -->
+
+
+
<!-- ##### FUNCTION RTjpeg_compressYUV420 ##### -->
<para>
@bp:
@Returns:
-<!-- ##### FUNCTION RTjpeg_compressYUV422 ##### -->
+<!-- ##### MACRO DFLT_SFQ ##### -->
<para>
</para>
-@sp:
-@bp:
-@Returns:
-<!-- ##### MACRO DFLT_SFQ ##### -->
+<!-- ##### FUNCTION RTjpeg_compressYUV422 ##### -->
<para>
</para>
+@sp:
+@bp:
+@Returns:
<!-- ##### TYPEDEF JSBS[3][SCALE_BLOCK][SBLIMIT] ##### -->
<para>
@searchForward:
@Returns:
-<!-- ##### MACRO MEM ##### -->
+<!-- ##### TYPEDEF IFFT[FFT_SIZE] ##### -->
<para>
</para>
-<!-- ##### TYPEDEF IFFT[FFT_SIZE] ##### -->
+<!-- ##### MACRO MEM ##### -->
<para>
</para>
</para>
-<!-- ##### SECTION ./tmpl/tables.sgml:Title ##### -->
-tables
-
-
<!-- ##### MACRO START_BLOCK ##### -->
<para>
</para>
+<!-- ##### SECTION ./tmpl/tables.sgml:Title ##### -->
+tables
+
+
<!-- ##### ARG GstV4lSrc:volume ##### -->
<para>
</para>
-<!-- ##### SECTION ./tmpl/output.sgml:Title ##### -->
-output
-
-
<!-- ##### MACRO P_FORBIDDEN ##### -->
<para>
</para>
+<!-- ##### SECTION ./tmpl/output.sgml:Title ##### -->
+output
+
+
<!-- ##### FUNCTION audio_decode ##### -->
<para>
@pcm:
@Returns:
-<!-- ##### FUNCTION gst_riff_get_nextlikely ##### -->
-<para>
-
-</para>
-
-@riff:
-@Returns:
-
<!-- ##### FUNCTION mpg123_synth_1to1 ##### -->
<para>
@pnt:
@Returns:
+<!-- ##### FUNCTION gst_riff_get_nextlikely ##### -->
+<para>
+
+</para>
+
+@riff:
+@Returns:
+
<!-- ##### FUNCTION II_CRC_calc ##### -->
<para>
</para>
-<!-- ##### FUNCTION PrintEhuff ##### -->
+<!-- ##### FUNCTION MakeFStore ##### -->
<para>
</para>
-@huff:
+@vid_stream:
-<!-- ##### FUNCTION MakeFStore ##### -->
+<!-- ##### FUNCTION PrintEhuff ##### -->
<para>
</para>
-@vid_stream:
+@huff:
<!-- ##### MACRO MB_PATTERN ##### -->
<para>
@name:
@Returns:
-<!-- ##### SECTION ./tmpl/config.sgml:See_Also ##### -->
+<!-- ##### MACRO P_INTERPOLATED ##### -->
<para>
</para>
-<!-- ##### MACRO P_INTERPOLATED ##### -->
+<!-- ##### SECTION ./tmpl/config.sgml:See_Also ##### -->
<para>
</para>
</para>
-<!-- ##### MACRO FILETYPE_ENCODE ##### -->
+<!-- ##### MACRO SEQUENCE_HEADER_CODE ##### -->
<para>
</para>
-<!-- ##### MACRO SEQUENCE_HEADER_CODE ##### -->
+<!-- ##### MACRO FILETYPE_ENCODE ##### -->
<para>
</para>
@Varargs:
@Returns:
-<!-- ##### MACRO MAC_WINDOW_SIZE ##### -->
+<!-- ##### SECTION ./tmpl/crc.sgml:Long_Description ##### -->
<para>
</para>
-<!-- ##### SECTION ./tmpl/crc.sgml:Long_Description ##### -->
+<!-- ##### MACRO MAC_WINDOW_SIZE ##### -->
<para>
</para>
@pad:
@buf:
-<!-- ##### SECTION ./tmpl/config.sgml:Short_Description ##### -->
-
-
-
<!-- ##### ARG VCDSrc:track ##### -->
<para>
</para>
-<!-- ##### SECTION ./tmpl/musicin.sgml:See_Also ##### -->
-<para>
+<!-- ##### SECTION ./tmpl/config.sgml:Short_Description ##### -->
-</para>
<!-- ##### SECTION ./tmpl/stats.sgml:Title ##### -->
stats
-<!-- ##### SECTION ./tmpl/mpeg2dec.sgml:Long_Description ##### -->
+<!-- ##### SECTION ./tmpl/musicin.sgml:See_Also ##### -->
<para>
</para>
</para>
+<!-- ##### SECTION ./tmpl/mpeg2dec.sgml:Long_Description ##### -->
+<para>
+
+</para>
+
+
<!-- ##### FUNCTION MakeFileNames ##### -->
<para>
@vid_stream:
-<!-- ##### SECTION ./tmpl/csize.sgml:Long_Description ##### -->
+<!-- ##### ARG GstVideoSink:frames_displayed ##### -->
<para>
</para>
-<!-- ##### ARG GstVideoSink:frames_displayed ##### -->
+<!-- ##### SECTION ./tmpl/csize.sgml:Long_Description ##### -->
<para>
</para>
</para>
+<!-- ##### FUNCTION ChenIDct ##### -->
+<para>
+
+</para>
+
+@x:
+@y:
+
<!-- ##### FUNCTION LoadMem ##### -->
<para>
@omem:
@Returns:
-<!-- ##### FUNCTION ChenIDct ##### -->
-<para>
-
-</para>
-
-@x:
-@y:
-
<!-- ##### MACRO MPEGLAYER1 ##### -->
<para>
</para>
-<!-- ##### MACRO WRITE_MODE ##### -->
+<!-- ##### MACRO ERROR_HUFFMAN_READ ##### -->
<para>
</para>
-<!-- ##### MACRO ERROR_HUFFMAN_READ ##### -->
+<!-- ##### MACRO WRITE_MODE ##### -->
<para>
</para>
</para>
-<!-- ##### MACRO sgetc ##### -->
+<!-- ##### SECTION ./tmpl/stats.sgml:Long_Description ##### -->
<para>
</para>
-<!-- ##### SECTION ./tmpl/stats.sgml:Long_Description ##### -->
+<!-- ##### MACRO sgetc ##### -->
<para>
</para>
</para>
-<!-- ##### MACRO MC_FIELD ##### -->
+<!-- ##### ARG GstVideoSink:xv_enabled ##### -->
<para>
</para>
-<!-- ##### ARG GstVideoSink:xv_enabled ##### -->
+<!-- ##### MACRO MC_FIELD ##### -->
<para>
</para>
</para>
-<!-- ##### MACRO ERROR_INIT_FILE ##### -->
-<para>
-
-</para>
-
-
<!-- ##### MACRO GST_PARSEAVI_MAX_VIDEO_PADS ##### -->
<para>
</para>
-<!-- ##### MACRO SEQSCAL_ID ##### -->
+<!-- ##### MACRO ERROR_INIT_FILE ##### -->
<para>
</para>
-<!-- ##### MACRO SYNA_BITS ##### -->
+<!-- ##### MACRO SEQSCAL_ID ##### -->
<para>
</para>
@Param1:
@Param2:
-<!-- ##### FUNCTION gst_spindentity_chain ##### -->
+<!-- ##### MACRO SYNA_BITS ##### -->
<para>
</para>
-@pad:
-@buf:
<!-- ##### FUNCTION MakeFrame ##### -->
<para>
@vid_stream:
+<!-- ##### FUNCTION gst_spindentity_chain ##### -->
+<para>
+
+</para>
+
+@pad:
+@buf:
+
<!-- ##### SECTION ./tmpl/itype.sgml:Long_Description ##### -->
<para>
</para>
+<!-- ##### SECTION ./tmpl/putbits.sgml:Title ##### -->
+putbits
+
+
<!-- ##### FUNCTION gst_volume_new ##### -->
<para>
@name:
@Returns:
-<!-- ##### SECTION ./tmpl/putbits.sgml:Title ##### -->
-putbits
-
-
<!-- ##### SECTION ./tmpl/downmix.sgml:See_Also ##### -->
<para>
</para>
-<!-- ##### SECTION ./tmpl/decode.sgml:Title ##### -->
-decode
+<!-- ##### SECTION ./tmpl/globals.sgml:See_Also ##### -->
+<para>
+
+</para>
<!-- ##### FUNCTION MakeFS ##### -->
@vid_stream:
@flag:
-<!-- ##### SECTION ./tmpl/globals.sgml:See_Also ##### -->
-<para>
-
-</para>
+<!-- ##### SECTION ./tmpl/decode.sgml:Title ##### -->
+decode
-<!-- ##### MACRO L_BD ##### -->
+<!-- ##### MACRO GRAB_ATTR_CONTRAST ##### -->
<para>
</para>
-<!-- ##### MACRO GRAB_ATTR_CONTRAST ##### -->
+<!-- ##### MACRO L_BD ##### -->
<para>
</para>
@Param1:
@Returns:
-<!-- ##### TYPEDEF SAMPLEINT ##### -->
+<!-- ##### MACRO MPEG1MUX_BUFFER_FIRST_TIMECODE ##### -->
<para>
</para>
+@mb:
<!-- ##### SECTION ./tmpl/grab.sgml:Long_Description ##### -->
<para>
</para>
-<!-- ##### MACRO MPEG1MUX_BUFFER_FIRST_TIMECODE ##### -->
+<!-- ##### TYPEDEF SAMPLEINT ##### -->
<para>
</para>
-@mb:
<!-- ##### SECTION ./tmpl/vlc.sgml:Long_Description ##### -->
<para>
</para>
-<!-- ##### SECTION ./tmpl/main.sgml:See_Also ##### -->
+<!-- ##### FUNCTION gst_mpeg1encoder_chain ##### -->
<para>
</para>
+@pad:
+@buf:
-<!-- ##### FUNCTION gst_mpeg1encoder_chain ##### -->
+<!-- ##### SECTION ./tmpl/main.sgml:See_Also ##### -->
<para>
</para>
-@pad:
-@buf:
<!-- ##### MACRO GST_PARSEWAV_CHUNK_FMT ##### -->
<para>
</para>
-<!-- ##### MACRO VIDEO_LUT2 ##### -->
+<!-- ##### MACRO MC_16X8 ##### -->
<para>
</para>
-<!-- ##### MACRO MC_16X8 ##### -->
+<!-- ##### MACRO VIDEO_LUT2 ##### -->
<para>
</para>
</para>
-<!-- ##### SECTION ./tmpl/putbits.sgml:Long_Description ##### -->
+<!-- ##### FUNCTION BoundIntegerMatrix ##### -->
<para>
</para>
+@matrix:
-<!-- ##### FUNCTION BoundIntegerMatrix ##### -->
+<!-- ##### SECTION ./tmpl/putbits.sgml:Long_Description ##### -->
<para>
</para>
-@matrix:
<!-- ##### TYPEDEF vFunc() ##### -->
<para>
</para>
-<!-- ##### FUNCTION set_mac_file_attr ##### -->
+<!-- ##### MACRO BLOCKHEIGHT ##### -->
<para>
</para>
-<!-- ##### MACRO BLOCKHEIGHT ##### -->
+<!-- ##### FUNCTION set_mac_file_attr ##### -->
<para>
</para>
-<!-- ##### MACRO ASM_X86_OLD ##### -->
+<!-- ##### MACRO LEVEL_MASK ##### -->
<para>
</para>
-<!-- ##### MACRO LEVEL_MASK ##### -->
+<!-- ##### MACRO ASM_X86_OLD ##### -->
<para>
</para>
@table:
-<!-- ##### MACRO GRAB_ATTR_MODE ##### -->
+<!-- ##### SECTION ./tmpl/encoder.sgml:Long_Description ##### -->
<para>
</para>
-<!-- ##### SECTION ./tmpl/encoder.sgml:Long_Description ##### -->
+<!-- ##### MACRO GRAB_ATTR_MODE ##### -->
<para>
</para>
@pb:
-<!-- ##### SECTION ./tmpl/parse.sgml:Long_Description ##### -->
+<!-- ##### MACRO PAST_LOCK ##### -->
<para>
</para>
-<!-- ##### MACRO PAST_LOCK ##### -->
+<!-- ##### SECTION ./tmpl/parse.sgml:Long_Description ##### -->
<para>
</para>
</para>
-<!-- ##### FUNCTION gtk_xvimage_new ##### -->
+<!-- ##### SECTION ./tmpl/mantissa.sgml:See_Also ##### -->
<para>
</para>
-@val:
-@Returns:
<!-- ##### SECTION ./tmpl/decoders.sgml:Short_Description ##### -->
-<!-- ##### SECTION ./tmpl/mantissa.sgml:See_Also ##### -->
-<para>
-
-</para>
-
-
-<!-- ##### MACRO ERROR_PREMATURE_EOF ##### -->
+<!-- ##### FUNCTION gtk_xvimage_new ##### -->
<para>
</para>
+@val:
+@Returns:
<!-- ##### SECTION ./tmpl/grab.sgml:See_Also ##### -->
<para>
</para>
-<!-- ##### MACRO LEVEL_SHIFT ##### -->
+<!-- ##### MACRO ERROR_PREMATURE_EOF ##### -->
<para>
</para>
@Returns:
-<!-- ##### MACRO ERROR_MEMORY ##### -->
+<!-- ##### MACRO LEVEL_SHIFT ##### -->
<para>
</para>
-<!-- ##### SECTION ./tmpl/mem.sgml:See_Also ##### -->
+<!-- ##### MACRO ERROR_MEMORY ##### -->
<para>
</para>
@name:
@Returns:
-<!-- ##### MACRO WINBITS ##### -->
+<!-- ##### SECTION ./tmpl/mem.sgml:See_Also ##### -->
<para>
</para>
-<!-- ##### TYPEDEF mb_addr_inc_entry ##### -->
+<!-- ##### MACRO WINBITS ##### -->
<para>
</para>
-<!-- ##### MACRO SKIP_TO_START_CODE ##### -->
+<!-- ##### TYPEDEF mb_addr_inc_entry ##### -->
<para>
</para>
@Returns:
-<!-- ##### MACRO MPG_LAYER_1 ##### -->
+<!-- ##### MACRO SKIP_TO_START_CODE ##### -->
<para>
</para>
-<!-- ##### MACRO MPG_LAYER_2 ##### -->
+<!-- ##### MACRO MPG_LAYER_1 ##### -->
<para>
</para>
</para>
-<!-- ##### MACRO MPG_LAYER_3 ##### -->
+<!-- ##### MACRO MPG_LAYER_2 ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### FUNCTION gst_videosink_chain ##### -->
<para>
</para>
+@pad:
+@buf:
<!-- ##### MACRO UDSC ##### -->
<para>
</para>
-<!-- ##### FUNCTION gst_videosink_chain ##### -->
+<!-- ##### MACRO MPG_LAYER_3 ##### -->
<para>
</para>
-@pad:
-@buf:
<!-- ##### MACRO gst_cobin_destroy ##### -->
<para>
@name:
@Returns:
-<!-- ##### SECTION ./tmpl/param.sgml:See_Also ##### -->
+<!-- ##### MACRO COEFFSUM_SCALE ##### -->
<para>
</para>
-<!-- ##### MACRO COEFFSUM_SCALE ##### -->
+<!-- ##### SECTION ./tmpl/param.sgml:See_Also ##### -->
<para>
</para>
+<!-- ##### SECTION ./tmpl/ring_buffer.sgml:Short_Description ##### -->
+
+
+
<!-- ##### FUNCTION ReadBlock ##### -->
<para>
@vid_stream:
@store:
-<!-- ##### SECTION ./tmpl/ring_buffer.sgml:Short_Description ##### -->
-
-
-
-<!-- ##### ARG VCDSrc:location ##### -->
+<!-- ##### MACRO MACROBLOCK_QUANT ##### -->
<para>
</para>
-<!-- ##### MACRO MACROBLOCK_QUANT ##### -->
+<!-- ##### ARG VCDSrc:location ##### -->
<para>
</para>
-<!-- ##### SECTION ./tmpl/video.sgml:Long_Description ##### -->
+<!-- ##### FUNCTION mpg123_decode_header ##### -->
<para>
</para>
+@fr:
+@header:
+@Returns:
<!-- ##### MACRO DFLT_EMP ##### -->
<para>
</para>
-<!-- ##### FUNCTION mpg123_decode_header ##### -->
+<!-- ##### SECTION ./tmpl/video.sgml:Long_Description ##### -->
<para>
</para>
-@fr:
-@header:
-@Returns:
<!-- ##### MACRO T_Y_U_V ##### -->
<para>
</para>
-<!-- ##### MACRO SC_DP ##### -->
+<!-- ##### MACRO L_BDBD ##### -->
<para>
</para>
</para>
-<!-- ##### MACRO L_BDBD ##### -->
+<!-- ##### MACRO SC_DP ##### -->
<para>
</para>
@name:
@Returns:
-<!-- ##### FUNCTION RTjpeg_yuvrgb8 ##### -->
+<!-- ##### MACRO IC_ONE_EIGHTH ##### -->
<para>
</para>
-@buf:
-@rgb:
-<!-- ##### MACRO IC_ONE_EIGHTH ##### -->
+<!-- ##### FUNCTION RTjpeg_yuvrgb8 ##### -->
<para>
</para>
+@buf:
+@rgb:
<!-- ##### MACRO IUBOUND ##### -->
<para>
RTjpeg
+<!-- ##### SECTION ./tmpl/htable.sgml:See_Also ##### -->
+<para>
+
+</para>
+
+
<!-- ##### FUNCTION new_ext ##### -->
<para>
@extname:
@Returns:
-<!-- ##### SECTION ./tmpl/htable.sgml:See_Also ##### -->
+<!-- ##### MACRO VIDEO_RGB16_BE ##### -->
<para>
</para>
@fourcc:
@Returns:
-<!-- ##### MACRO VIDEO_RGB16_BE ##### -->
-<para>
-
-</para>
-
-
<!-- ##### FUNCTION gst_jpegdec_new ##### -->
<para>
</para>
+<!-- ##### FUNCTION gst_stereo_chain ##### -->
+<para>
+
+</para>
+
+@pad:
+@buf:
+
<!-- ##### FUNCTION putbits_init ##### -->
<para>
@pb:
-<!-- ##### FUNCTION gst_stereo_chain ##### -->
+<!-- ##### FUNCTION mwseek ##### -->
<para>
</para>
-@pad:
-@buf:
+@vid_stream:
+@distance:
-<!-- ##### MACRO GST_PARSEAVI_MOVI ##### -->
+<!-- ##### SECTION ./tmpl/prototypes.sgml:See_Also ##### -->
<para>
</para>
-<!-- ##### SECTION ./tmpl/prototypes.sgml:See_Also ##### -->
+<!-- ##### MACRO GST_PARSEAVI_MOVI ##### -->
<para>
</para>
-<!-- ##### FUNCTION mwseek ##### -->
+<!-- ##### ARG GstWinEnc:avi_header ##### -->
<para>
</para>
-@vid_stream:
-@distance:
<!-- ##### SECTION ./tmpl/core.sgml:Title ##### -->
core
-<!-- ##### ARG GstWinEnc:avi_header ##### -->
+<!-- ##### FUNCTION double_to_extended ##### -->
<para>
</para>
+@Param1:
+@Param2:
<!-- ##### FUNCTION dct64 ##### -->
<para>
@out1:
@samples:
-<!-- ##### FUNCTION double_to_extended ##### -->
-<para>
-
-</para>
-
-@Param1:
-@Param2:
-
<!-- ##### SECTION ./tmpl/vlc.sgml:Title ##### -->
vlc
</para>
-<!-- ##### SECTION ./tmpl/ac3.sgml:See_Also ##### -->
+<!-- ##### MACRO LITTLE_ENDIAN ##### -->
<para>
</para>
-<!-- ##### MACRO LITTLE_ENDIAN ##### -->
+<!-- ##### SECTION ./tmpl/ac3.sgml:See_Also ##### -->
<para>
</para>
</para>
-<!-- ##### SECTION ./tmpl/exponent.sgml:Long_Description ##### -->
+<!-- ##### MACRO SKIPPED_PICTURE ##### -->
<para>
</para>
</para>
-<!-- ##### MACRO SKIPPED_PICTURE ##### -->
+<!-- ##### SECTION ./tmpl/exponent.sgml:Long_Description ##### -->
<para>
</para>
@name:
@Returns:
-<!-- ##### MACRO PICTURE_CODING_EXTENSION_ID ##### -->
+<!-- ##### FUNCTION gst_cobin_iterate ##### -->
<para>
</para>
+@cobin:
-<!-- ##### FUNCTION gst_cobin_iterate ##### -->
+<!-- ##### MACRO PICTURE_CODING_EXTENSION_ID ##### -->
<para>
</para>
-@cobin:
<!-- ##### MACRO NUM_MASK ##### -->
<para>
</para>
-<!-- ##### SECTION ./tmpl/qtables.sgml:Title ##### -->
-qtables
+<!-- ##### SECTION ./tmpl/ac3.sgml:Long_Description ##### -->
+<para>
+
+</para>
<!-- ##### FUNCTION gtk_overlay_image_new ##### -->
@Returns:
-<!-- ##### SECTION ./tmpl/ac3.sgml:Long_Description ##### -->
-<para>
-
-</para>
+<!-- ##### SECTION ./tmpl/qtables.sgml:Title ##### -->
+qtables
<!-- ##### MACRO RUN_MASK ##### -->
</para>
-<!-- ##### FUNCTION initme ##### -->
+<!-- ##### MACRO BIG_ENDIAN_ARCHITECTURE ##### -->
<para>
</para>
-@vid_stream:
-<!-- ##### MACRO BIG_ENDIAN_ARCHITECTURE ##### -->
+<!-- ##### FUNCTION initme ##### -->
<para>
</para>
+@vid_stream:
-<!-- ##### MACRO DCTSATURATE ##### -->
+<!-- ##### MACRO HUFFMAN_ESCAPE ##### -->
<para>
</para>
</para>
-<!-- ##### MACRO HUFFMAN_ESCAPE ##### -->
+<!-- ##### MACRO DCTSATURATE ##### -->
<para>
</para>
-<!-- ##### MACRO GRAB_ATTR_BRIGHT ##### -->
+<!-- ##### SECTION ./tmpl/debug.sgml:See_Also ##### -->
<para>
</para>
-<!-- ##### SECTION ./tmpl/debug.sgml:See_Also ##### -->
+<!-- ##### MACRO GRAB_ATTR_BRIGHT ##### -->
<para>
</para>
@vid_stream:
-<!-- ##### SECTION ./tmpl/gdkxvimage.sgml:See_Also ##### -->
+<!-- ##### MACRO L_DVAR ##### -->
<para>
</para>
-<!-- ##### MACRO L_DVAR ##### -->
+<!-- ##### SECTION ./tmpl/gdkxvimage.sgml:See_Also ##### -->
<para>
</para>
mpeg2dec
-<!-- ##### SECTION ./tmpl/dct.sgml:See_Also ##### -->
+<!-- ##### FUNCTION gst_xing_chain ##### -->
<para>
</para>
+@pad:
+@buf:
-<!-- ##### FUNCTION gst_xing_chain ##### -->
+<!-- ##### SECTION ./tmpl/dct.sgml:See_Also ##### -->
<para>
</para>
-@pad:
-@buf:
<!-- ##### TYPEDEF ID[4] ##### -->
<para>
</para>
-<!-- ##### SECTION ./tmpl/ctables.sgml:See_Also ##### -->
+<!-- ##### SECTION ./tmpl/imdct.sgml:Long_Description ##### -->
<para>
</para>
-<!-- ##### SECTION ./tmpl/imdct.sgml:Long_Description ##### -->
+<!-- ##### SECTION ./tmpl/ctables.sgml:See_Also ##### -->
<para>
</para>
@Param1:
-<!-- ##### MACRO FRAME ##### -->
+<!-- ##### MACRO MPG_MD_STEREO ##### -->
<para>
</para>
-<!-- ##### MACRO MPG_MD_STEREO ##### -->
+<!-- ##### MACRO FRAME ##### -->
<para>
</para>
</para>
-<!-- ##### MACRO EXSC_LENGTH ##### -->
+<!-- ##### ARG GstVideoSink:height ##### -->
<para>
</para>
util
-<!-- ##### ARG GstVideoSink:height ##### -->
+<!-- ##### MACRO EXSC_LENGTH ##### -->
<para>
</para>
-<!-- ##### TYPEDEF dct_dc_size_entry ##### -->
+<!-- ##### MACRO UMASK ##### -->
<para>
</para>
-<!-- ##### MACRO UMASK ##### -->
+<!-- ##### TYPEDEF dct_dc_size_entry ##### -->
<para>
</para>
</para>
+<!-- ##### SECTION ./tmpl/getvlc.sgml:Short_Description ##### -->
+
+
+
<!-- ##### STRUCT Mpeg1Stream ##### -->
<para>
@STD_buffer_bound_scale:
@STD_buffer_size_bound:
-<!-- ##### SECTION ./tmpl/getvlc.sgml:Short_Description ##### -->
-
-
-
-<!-- ##### SECTION ./tmpl/rematrix.sgml:Short_Description ##### -->
+<!-- ##### MACRO MB_INTRA ##### -->
+<para>
+</para>
<!-- ##### MACRO HAN_SIZE ##### -->
</para>
-<!-- ##### MACRO MB_INTRA ##### -->
-<para>
+<!-- ##### SECTION ./tmpl/rematrix.sgml:Short_Description ##### -->
-</para>
<!-- ##### MACRO LAST_SCR_BYTE_IN_PACK ##### -->
-<!-- ##### FUNCTION aiff_seek_to_sound_data ##### -->
+<!-- ##### SECTION ./tmpl/L3.sgml:See_Also ##### -->
<para>
</para>
-@Param1:
-@Returns:
-<!-- ##### SECTION ./tmpl/L3.sgml:See_Also ##### -->
+<!-- ##### FUNCTION aiff_seek_to_sound_data ##### -->
<para>
</para>
+@Param1:
+@Returns:
-<!-- ##### FUNCTION cvt_to_wave_test ##### -->
+<!-- ##### MACRO SKIP_PICTURE ##### -->
<para>
</para>
-@Returns:
-<!-- ##### MACRO SKIP_PICTURE ##### -->
+<!-- ##### FUNCTION cvt_to_wave_test ##### -->
<para>
</para>
+@Returns:
<!-- ##### FUNCTION gst_mpeg1encoder_new ##### -->
<para>
</para>
+<!-- ##### FUNCTION ChenDct ##### -->
+<para>
+
+</para>
+
+@x:
+@y:
+
<!-- ##### FUNCTION mpeg2play_new_buffer ##### -->
<para>
@first:
@Returns:
-<!-- ##### FUNCTION ChenDct ##### -->
-<para>
-
-</para>
-
-@x:
-@y:
-
<!-- ##### MACRO B_TYPE ##### -->
<para>
</para>
-<!-- ##### MACRO IN_PICTURE_PARSE ##### -->
+<!-- ##### MACRO SEQ_START_CODE ##### -->
<para>
</para>
-<!-- ##### MACRO SEQ_START_CODE ##### -->
+<!-- ##### MACRO IN_PICTURE_PARSE ##### -->
<para>
</para>
</para>
-<!-- ##### MACRO SKIP_JUNK ##### -->
+<!-- ##### MACRO GTK_OVERLAY_IMAGE_BYTE_ORDER ##### -->
<para>
</para>
+@obj:
-<!-- ##### MACRO GTK_OVERLAY_IMAGE_BYTE_ORDER ##### -->
+<!-- ##### MACRO SKIP_JUNK ##### -->
<para>
</para>
-@obj:
<!-- ##### TYPEDEF INT16 ##### -->
<para>
</para>
-<!-- ##### SECTION ./tmpl/htable.sgml:Short_Description ##### -->
-
-
-
<!-- ##### SECTION ./tmpl/jdw.sgml:Short_Description ##### -->
-<!-- ##### MACRO STREAMS_AUDIO ##### -->
-<para>
+<!-- ##### SECTION ./tmpl/htable.sgml:Short_Description ##### -->
-</para>
<!-- ##### SECTION ./tmpl/dga.sgml:Title ##### -->
dga
-<!-- ##### SECTION ./tmpl/encoder.sgml:See_Also ##### -->
+<!-- ##### MACRO STREAMS_AUDIO ##### -->
<para>
</para>
-<!-- ##### SECTION ./tmpl/putbits.sgml:See_Also ##### -->
+<!-- ##### SECTION ./tmpl/encoder.sgml:See_Also ##### -->
<para>
</para>
</para>
-<!-- ##### MACRO MV_FRAME ##### -->
+<!-- ##### SECTION ./tmpl/putbits.sgml:See_Also ##### -->
<para>
</para>
</para>
+<!-- ##### MACRO MV_FRAME ##### -->
+<para>
+
+</para>
+
+
<!-- ##### MACRO BLOCKSIZE ##### -->
<para>
</para>
-<!-- ##### FUNCTION aiff_read_headers ##### -->
+<!-- ##### MACRO ESCAPE ##### -->
<para>
</para>
-@Param1:
-@Param2:
-@Returns:
-<!-- ##### MACRO ESCAPE ##### -->
+<!-- ##### FUNCTION aiff_read_headers ##### -->
<para>
</para>
+@Param1:
+@Param2:
+@Returns:
<!-- ##### ARG GstV4lSrc:hue ##### -->
<para>
@info:
-<!-- ##### SECTION ./tmpl/gtkoverlayimage.sgml:Long_Description ##### -->
+<!-- ##### ARG GstVuMeter:volume ##### -->
<para>
</para>
-<!-- ##### ARG GstVuMeter:volume ##### -->
+<!-- ##### SECTION ./tmpl/gtkoverlayimage.sgml:Long_Description ##### -->
<para>
</para>
</para>
-<!-- ##### MACRO TALK ##### -->
+<!-- ##### MACRO PICTURE_SPATIAL_SCALABLE_EXTENSION_ID ##### -->
<para>
</para>
-<!-- ##### MACRO PICTURE_SPATIAL_SCALABLE_EXTENSION_ID ##### -->
+<!-- ##### MACRO TALK ##### -->
<para>
</para>
</para>
+<!-- ##### TYPEDEF INT32 ##### -->
+<para>
+
+</para>
+
+
<!-- ##### STRUCT Mpeg1MuxBuffer ##### -->
<para>
@new_frame:
@next_frame_time:
-<!-- ##### TYPEDEF INT32 ##### -->
-<para>
-
-</para>
-
-
<!-- ##### FUNCTION gst_jpeg_chain ##### -->
<para>
@pad:
@buf:
-<!-- ##### SECTION ./tmpl/bit_allocate.sgml:Long_Description ##### -->
+<!-- ##### TYPEDEF D640[640] ##### -->
<para>
</para>
-<!-- ##### TYPEDEF D640[640] ##### -->
+<!-- ##### SECTION ./tmpl/bit_allocate.sgml:Long_Description ##### -->
<para>
</para>
@image:
@val:
-<!-- ##### FUNCTION SubCompensate ##### -->
+<!-- ##### MACRO DELTA_BIT_NONE ##### -->
<para>
</para>
-@vid_stream:
-@matrix:
-@XIob:
-<!-- ##### MACRO DELTA_BIT_NONE ##### -->
+<!-- ##### FUNCTION SubCompensate ##### -->
<para>
</para>
+@vid_stream:
+@matrix:
+@XIob:
<!-- ##### SECTION ./tmpl/qtables.sgml:See_Also ##### -->
<para>
</para>
-<!-- ##### FUNCTION mpg123_init_conv16to8_table ##### -->
+<!-- ##### FUNCTION rematrix ##### -->
<para>
</para>
+@audblk:
+@coeffs:
<!-- ##### FUNCTION gst_aviencoder_make_video_header ##### -->
<para>
@bit_cnt:
@Returns:
-<!-- ##### FUNCTION rematrix ##### -->
+<!-- ##### FUNCTION mpg123_init_conv16to8_table ##### -->
<para>
</para>
-@audblk:
-@coeffs:
<!-- ##### FUNCTION crc_validate ##### -->
<para>
</para>
-<!-- ##### FUNCTION gst_mpg123_new ##### -->
+<!-- ##### FUNCTION gst_synaesthesia_chain ##### -->
<para>
</para>
-@name:
-@Returns:
+@pad:
+@buf:
-<!-- ##### FUNCTION gst_synaesthesia_chain ##### -->
+<!-- ##### FUNCTION gst_mpg123_new ##### -->
<para>
</para>
-@pad:
-@buf:
+@name:
+@Returns:
<!-- ##### ARG System_Encode:audio ##### -->
<para>
=====================================
+
+ srccaps = GST_PAD_CAPS (srcpad);
+ srctempl = FALSE;
+
+ do {
+
+ //no caps, get one
+ if (!srccaps)
+ {
+ if (srcpad->negotiatefunc && !srctempl)
+ {
+ srccaps = srcpad->negotiatefunc (srpad, srcaps, counter);
+ srctempl = FALSE;
+ }
+ else
+ {
+ srccaps = gst_pad_get_caps (srcpad);
+ srctempl = TRUE;
+ }
+ }
+
+ /* check against other pad */
+
+ // the other pad doesn't want to negotiate
+ if (!sinkpad->negotiatefunc)
+ {
+ sinkcaps = gst_pad_get_caps (sinkpad);
+
+ if (!sinkcaps)
+ break;
+
+ if (gst_caps_check_compatibility (srccaps, sinkcaps))
+ {
+ // cool
+ break;
+ }
+ }
+ else {
+ switch pads;
+ }
+
+ } while (counter < 100);
+
+
+
+
+
+
gst_pad_connect(gst_element_get_pad(decoder,"src"),
gst_element_get_pad(audiosink,"sink"));
- /* make it ready */
- gst_element_set_state(bin, GST_STATE_READY);
/* start playing */
gst_element_set_state(bin, GST_STATE_PLAYING);
#include <stdlib.h>
#include <gst/gst.h>
-gboolean playing;
-
-/* eos will be called when the src element has an end of stream */
-void eos(GstElement *element, gpointer data)
-{
- g_print("have eos, quitting\n");
-
- playing = FALSE;
-}
-
int main(int argc,char *argv[])
{
GstElement *disksrc, *audiosink, *parse, *decode, *queue;
disksrc = gst_elementfactory_make("disksrc", "disk_source");
g_assert(disksrc != NULL);
gtk_object_set(GTK_OBJECT(disksrc),"location", argv[1],NULL);
- gtk_signal_connect(GTK_OBJECT(disksrc),"eos",
- GTK_SIGNAL_FUNC(eos), thread);
parse = gst_elementfactory_make("mp3parse", "parse");
decode = gst_elementfactory_make("mpg123", "decode");
gst_pad_connect(gst_element_get_pad(queue,"src"),
gst_element_get_pad(audiosink,"sink"));
- /* make it ready */
- gst_element_set_state(GST_ELEMENT(bin), GST_STATE_READY);
/* start playing */
gst_element_set_state(GST_ELEMENT(bin), GST_STATE_PLAYING);
- playing = TRUE;
-
- while (playing) {
- gst_bin_iterate(GST_BIN(bin));
- }
+ while (gst_bin_iterate(GST_BIN(bin)));
gst_element_set_state(GST_ELEMENT(bin), GST_STATE_NULL);
xml = gst_xml_new ();
- //g_print ("%p\n", xml);
-
gtk_signal_connect (GTK_OBJECT (xml), "object_loaded", xml_loaded, xml);
ret = gst_xml_parse_file(xml, "xmlTest.gst", NULL);
gst_element_set_state(bin, GST_STATE_PLAYING);
- playing = TRUE;
-
while (gst_bin_iterate(GST_BIN(bin)));
gst_element_set_state(bin, GST_STATE_NULL);
static gboolean gst_audiosink_open_audio (GstAudioSink *sink);
static void gst_audiosink_close_audio (GstAudioSink *sink);
+static void gst_audiosink_sync_parms (GstAudioSink *audiosink);
static GstElementStateReturn gst_audiosink_change_state (GstElement *element);
+static GstPadNegotiateReturn gst_audiosink_negotiate (GstPad *pad, GstCaps **caps, gint counter);
static void gst_audiosink_set_arg (GtkObject *object, GtkArg *arg, guint id);
static void gst_audiosink_get_arg (GtkObject *object, GtkArg *arg, guint id);
{
audiosink->sinkpad = gst_pad_new_from_template (gst_audiosink_sink_template, "sink");
gst_element_add_pad (GST_ELEMENT (audiosink), audiosink->sinkpad);
+ gst_pad_set_negotiate_function (audiosink->sinkpad, gst_audiosink_negotiate);
gst_pad_set_chain_function (audiosink->sinkpad, gst_audiosink_chain);
GST_FLAG_SET (audiosink, GST_ELEMENT_THREAD_SUGGESTED);
}
+static GstPadNegotiateReturn
+gst_audiosink_negotiate (GstPad *pad, GstCaps **caps, gint counter)
+{
+ GstAudioSink *audiosink;
+
+ g_return_val_if_fail (pad != NULL, GST_PAD_NEGOTIATE_FAIL);
+ g_return_val_if_fail (GST_IS_PAD (pad), GST_PAD_NEGOTIATE_FAIL);
+
+ audiosink = GST_AUDIOSINK (gst_pad_get_parent (pad));
+
+ g_print ("audiosink: negotiate\n");
+ // we decide
+ if (counter == 0) {
+ *caps = NULL;
+ return GST_PAD_NEGOTIATE_TRY;
+ }
+ // have we got caps?
+ else if (*caps) {
+ if (audiosink->fd == -1) return GST_PAD_NEGOTIATE_FAIL;
+
+ audiosink->format = gst_caps_get_int (*caps, "format");
+ audiosink->channels = gst_caps_get_int (*caps, "channels");
+ audiosink->frequency = gst_caps_get_int (*caps, "rate");
+
+ gst_audiosink_sync_parms (audiosink);
+
+ // FIXME check if the qound card was really set to these caps,
+ // else send out another caps..
+
+ return GST_PAD_NEGOTIATE_AGREE;
+ }
+
+ return GST_PAD_NEGOTIATE_FAIL;
+}
+
static void
gst_audiosink_sync_parms (GstAudioSink *audiosink)
{
ioctl (audiosink->fd, SNDCTL_DSP_GETOSPACE, &ospace);
- g_print("audiosink: setting sound card to %dKHz %d bit %s (%d bytes buffer, %d fragment)\n",
+ g_print("audiosink: setting sound card to %dHz %d bit %s (%d bytes buffer, %d fragment)\n",
audiosink->frequency, audiosink->format,
(audiosink->channels == 2) ? "stereo" : "mono", ospace.bytes, frag);
gst_audiosink_chain (GstPad *pad, GstBuffer *buf)
{
GstAudioSink *audiosink;
- MetaAudioRaw *meta;
gboolean in_flush;
audio_buf_info ospace;
ioctl (audiosink->fd, SNDCTL_DSP_RESET, 0);
}
-
- meta = (MetaAudioRaw *)gst_buffer_get_first_meta (buf);
- if (meta != NULL) {
- if ((meta->format != audiosink->format) ||
- (meta->channels != audiosink->channels) ||
- (meta->frequency != audiosink->frequency))
- {
- audiosink->format = meta->format;
- audiosink->channels = meta->channels;
- audiosink->frequency = meta->frequency;
- gst_audiosink_sync_parms (audiosink);
- g_print("audiosink: sound device set to format %d, %d channels, %dHz\n",
- audiosink->format, audiosink->channels, audiosink->frequency);
- }
- }
-
gtk_signal_emit (GTK_OBJECT (audiosink), gst_audiosink_signals[SIGNAL_HANDOFF],
audiosink);
/* if we have it, set the default parameters and go have fun */
if (sink->fd >= 0) {
/* set card state */
- sink->format = AFMT_S16_LE;
- sink->channels = 2; /* stereo */
- sink->frequency = 44100;
- gst_audiosink_sync_parms (sink);
ioctl(sink->fd, SNDCTL_DSP_GETCAPS, &sink->caps);
g_print("audiosink: Capabilities\n");
gboolean
gst_caps_check_compatibility (GstCaps *fromcaps, GstCaps *tocaps)
{
- if (fromcaps == NULL ||
- tocaps == NULL) {
- GST_DEBUG (0,"gstcaps: no caps\n");
- return TRUE;
+ if (fromcaps == NULL) {
+ if (tocaps == NULL) {
+ GST_DEBUG (0,"gstcaps: no caps\n");
+ return TRUE;
+ }
+ else {
+ GST_DEBUG (0,"gstcaps: no src but destination caps\n");
+ return FALSE;
+ }
+ }
+ else {
+ if (tocaps == NULL) {
+ GST_DEBUG (0,"gstcaps: src caps and no dest caps\n");
+ return TRUE;
+ }
}
while (fromcaps) {
GstCaps* gst_caps_set_props (GstCaps *caps, GstProps *props);
GstProps* gst_caps_get_props (GstCaps *caps);
+#define gst_caps_set(caps, name, args...) gst_props_set ((caps)->properties, name, args)
+
+#define gst_caps_get_int(caps, name) gst_props_get_int ((caps)->properties, name)
+#define gst_caps_get_fourcc_int(caps, name) gst_props_get_fourcc_int ((caps)->properties, name)
+#define gst_caps_get_boolean(caps, name) gst_props_get_boolean ((caps)->properties, name)
+
GstCaps* gst_caps_get_by_name (GstCaps *caps, const gchar *name);
GstCaps* gst_caps_append (GstCaps *caps, GstCaps *capstoadd);
pad = gst_pad_new (name, templ->direction);
GST_PAD_PADTEMPLATE(pad) = templ;
- GST_PAD_CAPS (pad) = GST_PADTEMPLATE_CAPS (templ);
+ //GST_PAD_CAPS (pad) = GST_PADTEMPLATE_CAPS (templ);
return pad;
}
if (GST_PAD_CAPS (srcpad)) {
negotiated = gst_pad_renegotiate (srcpad);
}
- else {
+ else if (GST_PAD_CAPS (sinkpad)) {
negotiated = gst_pad_renegotiate (sinkpad);
}
+ else
+ negotiated = TRUE;
if (!negotiated) {
gst_pad_disconnect (GST_PAD (realsrc), GST_PAD (realsink));
*
* Set the capabilities of this pad.
*/
-void
+gboolean
gst_pad_set_caps (GstPad *pad,
GstCaps *caps)
{
- g_return_if_fail (pad != NULL);
- g_return_if_fail (GST_IS_REAL_PAD (pad)); // NOTE this restriction
+ g_return_val_if_fail (pad != NULL, FALSE);
+ g_return_val_if_fail (GST_IS_REAL_PAD (pad), FALSE); // NOTE this restriction
GST_PAD_CAPS(pad) = caps;
- gst_pad_renegotiate (pad);
+ return gst_pad_renegotiate (pad);
}
/**
g_return_val_if_fail (pad != NULL, NULL);
g_return_val_if_fail (GST_IS_PAD (pad), NULL);
- return GST_PAD_CAPS(pad);
+ if (GST_PAD_CAPS (pad))
+ return GST_PAD_CAPS (pad);
+ else if (GST_PAD_PADTEMPLATE (pad))
+ return GST_PADTEMPLATE_CAPS (GST_PAD_PADTEMPLATE (pad));
+
+ return NULL;
}
+GstCaps*
+gst_pad_get_padtemplate_caps (GstPad *pad)
+{
+ g_return_val_if_fail (pad != NULL, NULL);
+ g_return_val_if_fail (GST_IS_PAD (pad), NULL);
+
+ if (GST_PAD_PADTEMPLATE (pad))
+ return GST_PADTEMPLATE_CAPS (GST_PAD_PADTEMPLATE (pad));
+
+ return NULL;
+}
+
+
/**
* gst_pad_get_caps_by_name:
* @pad: the pad to get the capabilities from
gint counter = 0;
GstCaps *newcaps = NULL;
GstRealPad *peerpad, *currentpad, *otherpad;
- GstCaps *currentcaps;
GstPadDirection currentdirection;
+ GstPadNegotiateReturn result;
g_return_val_if_fail (pad != NULL, FALSE);
GST_DEBUG_PAD_NAME(pad), GST_DEBUG_PAD_NAME(peerpad));
newcaps = GST_PAD_CAPS (pad);
+ g_assert (newcaps != NULL);
+
+ currentdirection = GST_PAD_DIRECTION (currentpad);
do {
- currentcaps = newcaps;
- currentdirection = GST_PAD_DIRECTION (currentpad);
+ gboolean matchtempl;
- /* this pad wants to negotiate */
- if (currentpad->negotiatefunc) {
+ matchtempl = gst_caps_check_compatibility (newcaps, gst_pad_get_padtemplate_caps (GST_PAD (otherpad)));
- GST_DEBUG (GST_CAT_ELEMENT_PADS, "calling negotiate function on pad %s:%s, count=%d\n",
- GST_DEBUG_PAD_NAME(currentpad), counter);
- newcaps = (currentpad->negotiatefunc) (GST_PAD (currentpad), currentcaps, counter);
+ if (matchtempl) {
+ if (otherpad->negotiatefunc) {
+ GstRealPad *temp;
- if (newcaps == NULL && currentcaps != NULL) {
- GST_DEBUG (GST_CAT_ELEMENT_PADS, "pad %s:%s has refused, negotiation failed :(, count=%d\n",
- GST_DEBUG_PAD_NAME(currentpad), counter);
- return FALSE;
+ temp = currentpad;
+ currentpad = otherpad;
+ otherpad = temp;
+ }
+ else if (gst_caps_check_compatibility (newcaps, GST_PAD_CAPS (otherpad))) {
+ break;
}
- if (newcaps == currentcaps) {
- GST_DEBUG (GST_CAT_ELEMENT_PADS, "pad %s:%s aggreed with caps, count=%d\n",
- GST_DEBUG_PAD_NAME(currentpad), counter);
- break;
+ else {
+ newcaps = GST_PAD_CAPS (otherpad);
}
}
- /* this pad doesn't want to negotiate, take its caps and that will be it then */
else {
- GST_DEBUG (GST_CAT_ELEMENT_PADS, "getting caps from pad %s:%s, count=%d\n",
- GST_DEBUG_PAD_NAME(currentpad), counter);
- newcaps = GST_PAD_CAPS (currentpad);
+ newcaps = GST_PAD_CAPS (otherpad);
}
- /* we have a caps structure now */
-
- /* check if the other pad wants to negotiate */
- if (!otherpad->negotiatefunc) {
- GstCaps *srccaps = newcaps;
- GstCaps *targetcaps = otherpad->caps;
- /* the pad doesn't want to negotiate, so we check if the caps
- * we got from the current pad are compatible */
- GST_DEBUG (GST_CAT_ELEMENT_PADS, "pad %s:%s doesn't want to negotiate, count=%d\n",
- GST_DEBUG_PAD_NAME(otherpad), counter);
-
- // the other pad has no caps, all is ok
- if (!targetcaps)
- break;
-
- // make sure we check src to sink
- if (currentdirection == GST_PAD_SINK) {
- GstCaps *temp;
- GST_DEBUG (GST_CAT_ELEMENT_PADS, "swapping pad caps for comparison, count=%d\n",
- counter);
- temp = srccaps;
- srccaps = targetcaps;
- targetcaps = temp;
- }
+ counter++;
- if (gst_caps_check_compatibility (srccaps, targetcaps)) {
- GST_DEBUG (GST_CAT_ELEMENT_PADS, "pad %s:%s has compatible caps, count=%d\n",
- GST_DEBUG_PAD_NAME(otherpad), counter);
- /* we're lucky */
- break;
+ if (currentpad->negotiatefunc) {
+ result = currentpad->negotiatefunc (GST_PAD (currentpad), &newcaps, counter);
+
+ switch (result) {
+ case GST_PAD_NEGOTIATE_FAIL:
+ return FALSE;
+ case GST_PAD_NEGOTIATE_AGREE:
+ goto succeed;
+ case GST_PAD_NEGOTIATE_TRY:
+ break;
}
- /* else, we let the current pad select another caps */
}
- /* if the other pad wants to negotiate, setup the pointers */
else {
- GstRealPad *temp;
-
- GST_DEBUG (GST_CAT_ELEMENT_PADS, "switching pads for next phase\n");
-
- temp = currentpad;
- currentpad = otherpad;
- otherpad = temp;
+ return FALSE;
}
+
+ } while (counter < 100);
- counter++;
-
- } while (counter < 100); // FIXME
-
+succeed:
+
GST_DEBUG (GST_CAT_ELEMENT_PADS, "pads aggreed on caps :)\n");
/* here we have some sort of aggreement of the caps */
return TRUE;
}
-GstCaps*
-gst_pad_negotiate_proxy (GstPad *pad, GstCaps *caps, gint counter)
+GstPadNegotiateReturn
+gst_pad_negotiate_proxy (GstPad *pad, GstCaps **caps, gint counter)
{
GstRealPad *peer;
- GstCaps *newcaps = caps;
- g_return_val_if_fail (pad != NULL, NULL);
+ g_return_val_if_fail (pad != NULL, GST_PAD_NEGOTIATE_FAIL);
GST_DEBUG (GST_CAT_ELEMENT_PADS, "pad (%s:%s) proxied\n", GST_DEBUG_PAD_NAME (pad));
peer = GST_RPAD_PEER (pad);
- GST_PAD_CAPS (pad) = caps;
+ //GST_PAD_CAPS (pad) = caps;
if (peer) {
if (peer->negotiatefunc) {
GST_DEBUG (GST_CAT_ELEMENT_PADS, "calling negotiate on peer (%s:%s)\n", GST_DEBUG_PAD_NAME (peer));
- newcaps = peer->negotiatefunc (pad, caps, counter);
- }
- else {
- GstCaps *srccaps = newcaps;
- GstCaps *targetcaps = peer->caps;
-
- if (targetcaps) {
- if (GST_PAD_DIRECTION (pad) == GST_PAD_SINK) {
- GstCaps *temp;
-
- GST_DEBUG (GST_CAT_ELEMENT_PADS, "swapping pad caps for comparison, count=%d\n",
- counter);
- temp = srccaps;
- srccaps = targetcaps;
- targetcaps = temp;
- }
-
- if (gst_caps_check_compatibility (srccaps, targetcaps)) {
- GST_DEBUG (GST_CAT_ELEMENT_PADS, "pad %s:%s has compatible caps\n",
- GST_DEBUG_PAD_NAME(peer));
- }
- else {
- GST_DEBUG (GST_CAT_ELEMENT_PADS, "target caps but they didn't match %p %p\n", srccaps, targetcaps);
- return NULL;
- }
- }
+ return peer->negotiatefunc (peer, caps, counter);
}
}
- else {
- GST_DEBUG (GST_CAT_ELEMENT_PADS, "no peer\n");
- }
-
- if (caps == newcaps) {
- GST_PAD_CAPS (pad) = newcaps;
- if (peer) GST_PAD_CAPS (peer) = newcaps;
- }
- return newcaps;
+ return GST_PAD_NEGOTIATE_AGREE;
}
/**
GST_REGION_TIME_LEN,
} GstRegionType;
+typedef enum {
+ GST_PAD_NEGOTIATE_FAIL,
+ GST_PAD_NEGOTIATE_AGREE,
+ GST_PAD_NEGOTIATE_TRY,
+} GstPadNegotiateReturn;
+
/* this defines the functions used to chain buffers
* pad is the sink pad (so the same chain function can be used for N pads)
typedef GstBuffer *(*GstPadPullFunction) (GstPad *pad);
typedef GstBuffer *(*GstPadPullRegionFunction) (GstPad *pad, GstRegionType type, guint64 offset, guint64 len);
typedef gboolean (*GstPadEOSFunction) (GstPad *pad);
-typedef GstCaps* (*GstPadNegotiateFunction) (GstPad *pad, GstCaps *caps, gint count);
+typedef GstPadNegotiateReturn (*GstPadNegotiateFunction) (GstPad *pad, GstCaps **caps, gint count);
typedef enum {
GST_PAD_UNKNOWN,
void gst_pad_set_eos_function (GstPad *pad, GstPadEOSFunction eos);
void gst_pad_set_negotiate_function (GstPad *pad, GstPadNegotiateFunction nego);
-void gst_pad_set_caps (GstPad *pad, GstCaps *caps);
+gboolean gst_pad_set_caps (GstPad *pad, GstCaps *caps);
GstCaps* gst_pad_get_caps (GstPad *pad);
+GstCaps* gst_pad_get_padtemplate_caps (GstPad *pad);
gboolean gst_pad_check_compatibility (GstPad *srcpad, GstPad *sinkpad);
void gst_pad_set_element_private (GstPad *pad, gpointer priv);
void gst_pad_disconnect (GstPad *srcpad, GstPad *sinkpad);
gboolean gst_pad_renegotiate (GstPad *pad);
-GstCaps* gst_pad_negotiate_proxy (GstPad *pad, GstCaps* caps, gint count);
+GstPadNegotiateReturn gst_pad_negotiate_proxy (GstPad *pad, GstCaps **caps, gint count);
#if 1
void gst_pad_push (GstPad *pad, GstBuffer *buf);
static gint
props_compare_func (gconstpointer a,
- gconstpointer b)
+ gconstpointer b)
{
GstPropsEntry *entry1 = (GstPropsEntry *)a;
GstPropsEntry *entry2 = (GstPropsEntry *)b;
return (entry1->propid - entry2->propid);
}
+static gint
+props_find_func (gconstpointer a,
+ gconstpointer b)
+{
+ GstPropsEntry *entry2 = (GstPropsEntry *)a;
+ GQuark entry1 = (GQuark) GPOINTER_TO_INT (b);
+
+ return (entry1 - entry2->propid);
+}
+
/**
* gst_props_register:
* @factory: the factory to register
return props;
}
+GstProps*
+gst_props_set (GstProps *props, const gchar *name, GstPropsFactoryEntry entry, ...)
+{
+ GQuark quark;
+ GList *lentry;
+ va_list var_args;
+
+ quark = g_quark_from_string (name);
+
+ lentry = g_list_find_custom (props->properties, GINT_TO_POINTER (quark), props_find_func);
+
+ if (lentry) {
+ GstPropsEntry *thisentry;
+ GstPropsFactoryEntry value;
+
+ thisentry = (GstPropsEntry *)lentry->data;
+
+ va_start (var_args, entry);
+ // property name
+ value = (GstPropsFactoryEntry) entry;
+
+ switch (GPOINTER_TO_INT (value)) {
+ case GST_PROPS_INT_ID:
+ thisentry->propstype = GST_PROPS_INT_ID_NUM;
+ value = va_arg (var_args, GstPropsFactoryEntry);
+ thisentry->data.int_data = GPOINTER_TO_INT (value);
+ break;
+ case GST_PROPS_FOURCC_ID_NUM:
+ thisentry->propstype = GST_PROPS_FOURCC_ID_NUM;
+ value = va_arg (var_args, GstPropsFactoryEntry);
+ thisentry->data.fourcc_data = GPOINTER_TO_INT (value);
+ break;
+ case GST_PROPS_BOOL_ID_NUM:
+ thisentry->propstype = GST_PROPS_BOOL_ID_NUM;
+ value = va_arg (var_args, GstPropsFactoryEntry);
+ thisentry->data.bool_data = GPOINTER_TO_INT (value);
+ break;
+ default:
+ g_print("gstprops: type not allowed\n");
+ break;
+ }
+ }
+ else {
+ g_print("gstprops: no property '%s' to change\n", name);
+ }
+
+ return props;
+}
+
+gint
+gst_props_get_int (GstProps *props, const gchar *name)
+{
+ GList *lentry;
+ GQuark quark;
+
+ quark = g_quark_from_string (name);
+
+ lentry = g_list_find_custom (props->properties, GINT_TO_POINTER (quark), props_find_func);
+
+ if (lentry) {
+ GstPropsEntry *thisentry;
+
+ thisentry = (GstPropsEntry *)lentry->data;
+
+ return thisentry->data.int_data;
+ }
+
+ return 0;
+}
+
+gulong
+gst_props_get_fourcc_int (GstProps *props, const gchar *name)
+{
+ GList *lentry;
+ GQuark quark;
+
+ quark = g_quark_from_string (name);
+
+ lentry = g_list_find_custom (props->properties, GINT_TO_POINTER (quark), props_find_func);
+
+ if (lentry) {
+ GstPropsEntry *thisentry;
+
+ thisentry = (GstPropsEntry *)lentry->data;
+
+ return thisentry->data.fourcc_data;
+ }
+
+ return 0;
+}
+
+gboolean
+gst_props_get_boolean (GstProps *props, const gchar *name)
+{
+ GList *lentry;
+ GQuark quark;
+
+ quark = g_quark_from_string (name);
+
+ lentry = g_list_find_custom (props->properties, GINT_TO_POINTER (quark), props_find_func);
+
+ if (lentry) {
+ GstPropsEntry *thisentry;
+
+ thisentry = (GstPropsEntry *)lentry->data;
+
+ return thisentry->data.bool_data;
+ }
+
+ return 0;
+}
+
/**
* gst_props_merge:
* @props: the property to merge into
GST_PROPS_LAST_ID_NUM = GST_PROPS_END_ID_NUM + 16,
} GstPropsId;
-#define GST_PROPS_END_ID GINT_TO_POINTER(GST_PROPS_END_ID_NUM)
-#define GST_PROPS_LIST_ID GINT_TO_POINTER(GST_PROPS_LIST_ID_NUM)
-#define GST_PROPS_INT_ID GINT_TO_POINTER(GST_PROPS_INT_ID_NUM)
-#define GST_PROPS_INT_RANGE_ID GINT_TO_POINTER(GST_PROPS_INT_RANGE_ID_NUM)
-#define GST_PROPS_FOURCC_ID GINT_TO_POINTER(GST_PROPS_FOURCC_ID_NUM)
-#define GST_PROPS_BOOL_ID GINT_TO_POINTER(GST_PROPS_BOOL_ID_NUM)
-#define GST_PROPS_LAST_ID GINT_TO_POINTER(GST_PROPS_LAST_ID_NUM)
-
-#define GST_PROPS_LIST(a...) GST_PROPS_LIST_ID,##a,NULL
-#define GST_PROPS_INT(a) GST_PROPS_INT_ID,(GINT_TO_POINTER(a))
-#define GST_PROPS_INT_RANGE(a,b) GST_PROPS_INT_RANGE_ID,(GINT_TO_POINTER(a)),(GINT_TO_POINTER(b))
-#define GST_PROPS_FOURCC(a,b,c,d) GST_PROPS_FOURCC_ID,(GINT_TO_POINTER((a)|(b)<<8|(c)<<16|(d)<<24))
-#define GST_PROPS_FOURCC_INT(a) GST_PROPS_FOURCC_ID,(GINT_TO_POINTER(a))
-#define GST_PROPS_BOOLEAN(a) GST_PROPS_BOOL_ID,(GINT_TO_POINTER(a))
+#define GST_PROPS_END_ID GINT_TO_POINTER(GST_PROPS_END_ID_NUM)
+#define GST_PROPS_LIST_ID GINT_TO_POINTER(GST_PROPS_LIST_ID_NUM)
+#define GST_PROPS_INT_ID GINT_TO_POINTER(GST_PROPS_INT_ID_NUM)
+#define GST_PROPS_INT_RANGE_ID GINT_TO_POINTER(GST_PROPS_INT_RANGE_ID_NUM)
+#define GST_PROPS_FOURCC_ID GINT_TO_POINTER(GST_PROPS_FOURCC_ID_NUM)
+#define GST_PROPS_BOOL_ID GINT_TO_POINTER(GST_PROPS_BOOL_ID_NUM)
+#define GST_PROPS_LAST_ID GINT_TO_POINTER(GST_PROPS_LAST_ID_NUM)
+
+#define GST_PROPS_LIST(a...) GST_PROPS_LIST_ID,##a,NULL
+#define GST_PROPS_INT(a) GST_PROPS_INT_ID,(GINT_TO_POINTER(a))
+#define GST_PROPS_INT_RANGE(a,b) GST_PROPS_INT_RANGE_ID,(GINT_TO_POINTER(a)),(GINT_TO_POINTER(b))
+#define GST_PROPS_FOURCC(a,b,c,d) GST_PROPS_FOURCC_ID,(GINT_TO_POINTER((a)|(b)<<8|(c)<<16|(d)<<24))
+#define GST_PROPS_FOURCC_INT(a) GST_PROPS_FOURCC_ID,(GINT_TO_POINTER(a))
+#define GST_PROPS_BOOLEAN(a) GST_PROPS_BOOL_ID,(GINT_TO_POINTER(a))
struct _GstProps {
gboolean gst_props_check_compatibility (GstProps *fromprops, GstProps *toprops);
+GstProps* gst_props_set (GstProps *props, const gchar *name, GstPropsFactoryEntry value, ...);
+
+gint gst_props_get_int (GstProps *props, const gchar *name);
+gulong gst_props_get_fourcc_int (GstProps *props, const gchar *name);
+gboolean gst_props_get_boolean (GstProps *props, const gchar *name);
+
xmlNodePtr gst_props_save_thyself (GstProps *props, xmlNodePtr parent);
GstProps* gst_props_load_thyself (xmlNodePtr parent);
static void gst_queue_get_arg (GtkObject *object, GtkArg *arg, guint id);
static gboolean gst_queue_handle_eos (GstPad *pad);
-static GstCaps* gst_queue_handle_negotiate_src (GstPad *pad, GstCaps *caps, gint count);
-static GstCaps* gst_queue_handle_negotiate_sink (GstPad *pad, GstCaps *caps, gint count);
+static GstPadNegotiateReturn gst_queue_handle_negotiate_src (GstPad *pad, GstCaps **caps, gint count);
+static GstPadNegotiateReturn gst_queue_handle_negotiate_sink (GstPad *pad, GstCaps **caps, gint count);
static void gst_queue_chain (GstPad *pad, GstBuffer *buf);
static GstBuffer * gst_queue_get (GstPad *pad);
queue->fullcond = g_cond_new ();
}
-static GstCaps*
-gst_queue_handle_negotiate_src (GstPad *pad, GstCaps *caps, gint count)
+static GstPadNegotiateReturn
+gst_queue_handle_negotiate_src (GstPad *pad, GstCaps **caps, gint count)
{
GstQueue *queue;
return gst_pad_negotiate_proxy (queue->sinkpad, caps, count);
}
-static GstCaps*
-gst_queue_handle_negotiate_sink (GstPad *pad, GstCaps *caps, gint count)
+static GstPadNegotiateReturn
+gst_queue_handle_negotiate_sink (GstPad *pad, GstCaps **caps, gint count)
{
GstQueue *queue;
static gboolean gst_audiosink_open_audio (GstAudioSink *sink);
static void gst_audiosink_close_audio (GstAudioSink *sink);
+static void gst_audiosink_sync_parms (GstAudioSink *audiosink);
static GstElementStateReturn gst_audiosink_change_state (GstElement *element);
+static GstPadNegotiateReturn gst_audiosink_negotiate (GstPad *pad, GstCaps **caps, gint counter);
static void gst_audiosink_set_arg (GtkObject *object, GtkArg *arg, guint id);
static void gst_audiosink_get_arg (GtkObject *object, GtkArg *arg, guint id);
{
audiosink->sinkpad = gst_pad_new_from_template (gst_audiosink_sink_template, "sink");
gst_element_add_pad (GST_ELEMENT (audiosink), audiosink->sinkpad);
+ gst_pad_set_negotiate_function (audiosink->sinkpad, gst_audiosink_negotiate);
gst_pad_set_chain_function (audiosink->sinkpad, gst_audiosink_chain);
GST_FLAG_SET (audiosink, GST_ELEMENT_THREAD_SUGGESTED);
}
+static GstPadNegotiateReturn
+gst_audiosink_negotiate (GstPad *pad, GstCaps **caps, gint counter)
+{
+ GstAudioSink *audiosink;
+
+ g_return_val_if_fail (pad != NULL, GST_PAD_NEGOTIATE_FAIL);
+ g_return_val_if_fail (GST_IS_PAD (pad), GST_PAD_NEGOTIATE_FAIL);
+
+ audiosink = GST_AUDIOSINK (gst_pad_get_parent (pad));
+
+ g_print ("audiosink: negotiate\n");
+ // we decide
+ if (counter == 0) {
+ *caps = NULL;
+ return GST_PAD_NEGOTIATE_TRY;
+ }
+ // have we got caps?
+ else if (*caps) {
+ if (audiosink->fd == -1) return GST_PAD_NEGOTIATE_FAIL;
+
+ audiosink->format = gst_caps_get_int (*caps, "format");
+ audiosink->channels = gst_caps_get_int (*caps, "channels");
+ audiosink->frequency = gst_caps_get_int (*caps, "rate");
+
+ gst_audiosink_sync_parms (audiosink);
+
+ // FIXME check if the qound card was really set to these caps,
+ // else send out another caps..
+
+ return GST_PAD_NEGOTIATE_AGREE;
+ }
+
+ return GST_PAD_NEGOTIATE_FAIL;
+}
+
static void
gst_audiosink_sync_parms (GstAudioSink *audiosink)
{
ioctl (audiosink->fd, SNDCTL_DSP_GETOSPACE, &ospace);
- g_print("audiosink: setting sound card to %dKHz %d bit %s (%d bytes buffer, %d fragment)\n",
+ g_print("audiosink: setting sound card to %dHz %d bit %s (%d bytes buffer, %d fragment)\n",
audiosink->frequency, audiosink->format,
(audiosink->channels == 2) ? "stereo" : "mono", ospace.bytes, frag);
gst_audiosink_chain (GstPad *pad, GstBuffer *buf)
{
GstAudioSink *audiosink;
- MetaAudioRaw *meta;
gboolean in_flush;
audio_buf_info ospace;
ioctl (audiosink->fd, SNDCTL_DSP_RESET, 0);
}
-
- meta = (MetaAudioRaw *)gst_buffer_get_first_meta (buf);
- if (meta != NULL) {
- if ((meta->format != audiosink->format) ||
- (meta->channels != audiosink->channels) ||
- (meta->frequency != audiosink->frequency))
- {
- audiosink->format = meta->format;
- audiosink->channels = meta->channels;
- audiosink->frequency = meta->frequency;
- gst_audiosink_sync_parms (audiosink);
- g_print("audiosink: sound device set to format %d, %d channels, %dHz\n",
- audiosink->format, audiosink->channels, audiosink->frequency);
- }
- }
-
gtk_signal_emit (GTK_OBJECT (audiosink), gst_audiosink_signals[SIGNAL_HANDOFF],
audiosink);
/* if we have it, set the default parameters and go have fun */
if (sink->fd >= 0) {
/* set card state */
- sink->format = AFMT_S16_LE;
- sink->channels = 2; /* stereo */
- sink->frequency = 44100;
- gst_audiosink_sync_parms (sink);
ioctl(sink->fd, SNDCTL_DSP_GETCAPS, &sink->caps);
g_print("audiosink: Capabilities\n");
static void gst_queue_get_arg (GtkObject *object, GtkArg *arg, guint id);
static gboolean gst_queue_handle_eos (GstPad *pad);
-static GstCaps* gst_queue_handle_negotiate_src (GstPad *pad, GstCaps *caps, gint count);
-static GstCaps* gst_queue_handle_negotiate_sink (GstPad *pad, GstCaps *caps, gint count);
+static GstPadNegotiateReturn gst_queue_handle_negotiate_src (GstPad *pad, GstCaps **caps, gint count);
+static GstPadNegotiateReturn gst_queue_handle_negotiate_sink (GstPad *pad, GstCaps **caps, gint count);
static void gst_queue_chain (GstPad *pad, GstBuffer *buf);
static GstBuffer * gst_queue_get (GstPad *pad);
queue->fullcond = g_cond_new ();
}
-static GstCaps*
-gst_queue_handle_negotiate_src (GstPad *pad, GstCaps *caps, gint count)
+static GstPadNegotiateReturn
+gst_queue_handle_negotiate_src (GstPad *pad, GstCaps **caps, gint count)
{
GstQueue *queue;
return gst_pad_negotiate_proxy (queue->sinkpad, caps, count);
}
-static GstCaps*
-gst_queue_handle_negotiate_sink (GstPad *pad, GstCaps *caps, gint count)
+static GstPadNegotiateReturn
+gst_queue_handle_negotiate_sink (GstPad *pad, GstCaps **caps, gint count)
{
GstQueue *queue;
gst_pad_connect(gst_element_get_pad(decoder,"src"),
gst_element_get_pad(audiosink,"sink"));
- /* make it ready */
- gst_element_set_state(bin, GST_STATE_READY);
/* start playing */
gst_element_set_state(bin, GST_STATE_PLAYING);
#include <stdlib.h>
#include <gst/gst.h>
-gboolean playing;
-
-/* eos will be called when the src element has an end of stream */
-void eos(GstElement *element, gpointer data)
-{
- g_print("have eos, quitting\n");
-
- playing = FALSE;
-}
-
int main(int argc,char *argv[])
{
GstElement *disksrc, *audiosink, *parse, *decode, *queue;
disksrc = gst_elementfactory_make("disksrc", "disk_source");
g_assert(disksrc != NULL);
gtk_object_set(GTK_OBJECT(disksrc),"location", argv[1],NULL);
- gtk_signal_connect(GTK_OBJECT(disksrc),"eos",
- GTK_SIGNAL_FUNC(eos), thread);
parse = gst_elementfactory_make("mp3parse", "parse");
decode = gst_elementfactory_make("mpg123", "decode");
gst_pad_connect(gst_element_get_pad(queue,"src"),
gst_element_get_pad(audiosink,"sink"));
- /* make it ready */
- gst_element_set_state(GST_ELEMENT(bin), GST_STATE_READY);
/* start playing */
gst_element_set_state(GST_ELEMENT(bin), GST_STATE_PLAYING);
- playing = TRUE;
-
- while (playing) {
- gst_bin_iterate(GST_BIN(bin));
- }
+ while (gst_bin_iterate(GST_BIN(bin)));
gst_element_set_state(GST_ELEMENT(bin), GST_STATE_NULL);
xml = gst_xml_new ();
- //g_print ("%p\n", xml);
-
gtk_signal_connect (GTK_OBJECT (xml), "object_loaded", xml_loaded, xml);
ret = gst_xml_parse_file(xml, "xmlTest.gst", NULL);
gst_element_set_state(bin, GST_STATE_PLAYING);
- playing = TRUE;
-
while (gst_bin_iterate(GST_BIN(bin)));
gst_element_set_state(bin, GST_STATE_NULL);
--- /dev/null
+Makefile
+Makefile.in
+*.o
+*.lo
+*.la
+.deps
+.libs
+capsnego
+converter
--- /dev/null
+SUBDIRS =
+
+testprogs = capsnego converter
+
+TESTS = $(testprogs)
+
+check_PROGRAMS = $(testprogs)
+
+# we have nothing but apps here, we can do this safely
+LIBS += $(GST_LIBS)
+CFLAGS += $(GST_CFLAGS)
--- /dev/null
+
+#include <gst/gst.h>
+
+GstPad *srcpad, *sinkpad;
+GstPad *srcpadtempl, *sinkpadtempl;
+
+static GstPadFactory src_factory = {
+ "src",
+ GST_PAD_FACTORY_SRC,
+ GST_PAD_FACTORY_ALWAYS,
+ GST_PAD_FACTORY_CAPS(
+ "test_src",
+ "video/raw",
+ "height", GST_PROPS_INT_RANGE (16, 4096)
+ ),
+ NULL,
+};
+
+static GstPadFactory sink_factory = {
+ "sink",
+ GST_PAD_FACTORY_SINK,
+ GST_PAD_FACTORY_ALWAYS,
+ GST_PAD_FACTORY_CAPS(
+ "test_sink",
+ "video/raw",
+ "height", GST_PROPS_INT_RANGE (16, 8192)
+ ),
+ NULL,
+};
+
+static GstCapsFactory sink_caps = {
+ "sink_caps",
+ "video/raw",
+ "height", GST_PROPS_INT (3000),
+ NULL
+};
+
+static GstCapsFactory src_caps = {
+ "src_caps",
+ "video/raw",
+ "height", GST_PROPS_INT (3000),
+ NULL
+};
+
+static GstPadTemplate *srctempl, *sinktempl;
+static GstCaps *srccaps, *sinkcaps;
+
+static GstPadNegotiateReturn
+negotiate_src (GstPad *pad, GstCaps **caps, gint counter)
+{
+ g_print (">");
+
+ if (counter == 0) {
+ *caps = NULL;
+ return GST_PAD_NEGOTIATE_TRY;
+ }
+ if (*caps)
+ return GST_PAD_NEGOTIATE_AGREE;
+
+ return GST_PAD_NEGOTIATE_FAIL;
+}
+
+static GstPadNegotiateReturn
+negotiate_sink (GstPad *pad, GstCaps **caps, gint counter)
+{
+ g_print ("<");
+ if (counter == 0) {
+ *caps = NULL;
+ return GST_PAD_NEGOTIATE_TRY;
+ }
+ if (*caps)
+ return GST_PAD_NEGOTIATE_AGREE;
+
+ return GST_PAD_NEGOTIATE_FAIL;
+}
+
+static gboolean
+perform_check (void)
+{
+ gboolean result, overall = TRUE;
+
+ gint i, j;
+
+ g_print ("ABC: A=pad caps, B=pad template, C=negotiate function\n");
+
+ for (j=0; j<8; j++) {
+ GstPad *srctest, *sinktest;
+
+ for (i=0; i<8; i++) {
+
+ (j & 0x2 ? (sinktest = sinkpadtempl) : (sinktest = sinkpad));
+ (j & 0x4 ? (gst_pad_set_caps (sinktest, sinkcaps)) : (gst_pad_set_caps (sinktest, NULL)));
+ (j & 0x1 ? (gst_pad_set_negotiate_function (sinktest, negotiate_sink)) :
+ gst_pad_set_negotiate_function (sinktest, NULL));
+
+ (i & 0x2 ? (srctest = srcpadtempl) : (srctest = srcpad));
+ (i & 0x4 ? (gst_pad_set_caps (srctest, srccaps)) : (gst_pad_set_caps (srctest, NULL)));
+ (i & 0x1 ? (gst_pad_set_negotiate_function (srctest, negotiate_src)) :
+ gst_pad_set_negotiate_function (srctest, NULL));
+
+
+ g_print ("%d%d%d -> %d%d%d ..", (i&4)>>2, (i&2)>>1, i&1, (j&4)>>2, (j&2)>>1, j&1);
+ result = gst_pad_connect (srctest, sinktest);
+
+ g_print (".. %s\n", (result? "ok":"fail"));
+ if (result) gst_pad_disconnect (srctest, sinktest);
+
+ overall &= result;
+ }
+ }
+ return overall;
+}
+
+int
+main (int argc, char *argv[])
+{
+ gboolean overall = TRUE;
+
+ gst_init (&argc, &argv);
+
+ srcpad = gst_pad_new ("src", GST_PAD_SRC);
+ sinkpad = gst_pad_new ("sink", GST_PAD_SINK);
+
+ srctempl = gst_padtemplate_new (&src_factory);
+ sinktempl = gst_padtemplate_new (&sink_factory);
+
+ srcpadtempl = gst_pad_new_from_template (srctempl, "src");
+ sinkpadtempl = gst_pad_new_from_template (sinktempl, "sink");
+
+ sinkcaps = gst_caps_register (&sink_caps);
+ srccaps = gst_caps_register (&src_caps);
+
+ g_print ("*** compatible caps/templates ***\n");
+
+ overall &= perform_check ();
+
+ gst_caps_set (srccaps, "height", GST_PROPS_INT (9000));
+
+ g_print ("*** incompatible caps ***\n");
+ overall &= perform_check ();
+
+ exit (!overall);
+}
--- /dev/null
+
+#include <gst/gst.h>
+
+GstPad *srcpad, *sinkpad;
+GstPad *srcconvpad, *sinkconvpad;
+GstPad *srcpadtempl, *sinkpadtempl;
+GstPad *srcconvtempl, *sinkconvtempl;
+
+gint converter_in = -1, converter_out = -1;
+
+static GstPadFactory src_factory = {
+ "src",
+ GST_PAD_FACTORY_SRC,
+ GST_PAD_FACTORY_ALWAYS,
+ GST_PAD_FACTORY_CAPS(
+ "test_src",
+ "audio/raw",
+ "rate", GST_PROPS_INT_RANGE (16, 20000)
+ ),
+ NULL,
+};
+
+static GstPadFactory src_conv_factory = {
+ "src",
+ GST_PAD_FACTORY_SRC,
+ GST_PAD_FACTORY_ALWAYS,
+ GST_PAD_FACTORY_CAPS(
+ "test_src",
+ "audio/raw",
+ "rate", GST_PROPS_INT_RANGE (16, 20000)
+ ),
+ NULL,
+};
+
+static GstPadFactory sink_conv_factory = {
+ "src",
+ GST_PAD_FACTORY_SINK,
+ GST_PAD_FACTORY_ALWAYS,
+ GST_PAD_FACTORY_CAPS(
+ "test_src",
+ "audio/raw",
+ "rate", GST_PROPS_INT_RANGE (16, 20000)
+ ),
+ NULL,
+};
+
+static GstPadFactory sink_factory = {
+ "sink",
+ GST_PAD_FACTORY_SINK,
+ GST_PAD_FACTORY_ALWAYS,
+ GST_PAD_FACTORY_CAPS(
+ "test_sink",
+ "audio/raw",
+ "rate", GST_PROPS_INT_RANGE (16, 20000)
+ ),
+ NULL,
+};
+
+static GstCapsFactory sink_caps = {
+ "sink_caps",
+ "audio/raw",
+ "rate", GST_PROPS_INT (6000),
+ NULL
+};
+
+static GstCapsFactory src_caps = {
+ "src_caps",
+ "audio/raw",
+ "rate", GST_PROPS_INT (3000),
+ NULL
+};
+
+static GstPadTemplate *srctempl, *sinktempl;
+static GstCaps *srccaps, *sinkcaps;
+
+static GstPadNegotiateReturn
+negotiate_src (GstPad *pad, GstCaps **caps, gint counter)
+{
+ g_print (">");
+
+ if (counter == 0) {
+ *caps = NULL;
+ return GST_PAD_NEGOTIATE_TRY;
+ }
+ if (*caps) {
+ converter_out = gst_caps_get_int (*caps, "rate");
+ return GST_PAD_NEGOTIATE_AGREE;
+ }
+
+ return GST_PAD_NEGOTIATE_FAIL;
+}
+
+static GstPadNegotiateReturn
+negotiate_sink (GstPad *pad, GstCaps **caps, gint counter)
+{
+ g_print ("<");
+ if (counter == 0) {
+ *caps = NULL;
+ return GST_PAD_NEGOTIATE_TRY;
+ }
+ if (*caps) {
+ converter_in = gst_caps_get_int (*caps, "rate");
+ return GST_PAD_NEGOTIATE_AGREE;
+ }
+
+ return GST_PAD_NEGOTIATE_FAIL;
+}
+
+int
+main (int argc, char *argv[])
+{
+ gboolean overall = TRUE;
+ gboolean result;
+
+ gst_init (&argc, &argv);
+
+ srctempl = gst_padtemplate_new (&src_factory);
+ sinktempl = gst_padtemplate_new (&sink_factory);
+ srcpad = gst_pad_new_from_template (srctempl, "src");
+ sinkpad = gst_pad_new_from_template (sinktempl, "sink");
+
+ srcconvtempl = gst_padtemplate_new (&src_conv_factory);
+ sinkconvtempl = gst_padtemplate_new (&sink_conv_factory);
+ srcconvpad = gst_pad_new_from_template (srcconvtempl, "src");
+ sinkconvpad = gst_pad_new_from_template (sinkconvtempl, "sink");
+
+ gst_pad_set_negotiate_function (srcconvpad, negotiate_src);
+ gst_pad_set_negotiate_function (sinkconvpad, negotiate_sink);
+
+ sinkcaps = gst_caps_register (&sink_caps);
+ srccaps = gst_caps_register (&src_caps);
+ result = gst_pad_set_caps (srcpad, srccaps);
+ g_print ("set caps on src: %d\n", result);
+ g_print ("initial converter status: %d %d\n", converter_in, converter_out);
+
+ result = gst_pad_connect (srcpad, sinkconvpad);
+ g_print ("pad connect 1: %d\n", result);
+ overall &= (result == TRUE);
+ result = gst_pad_connect (srcconvpad, sinkpad);
+ g_print ("pad connect 2: %d\n", result);
+ overall &= (result == TRUE);
+
+ g_print ("after connect, converter status: %d %d\n", converter_in, converter_out);
+
+ result = gst_pad_set_caps (srcpad, srccaps);
+ g_print ("src pad set caps %d, converter status: %d %d\n", result, converter_in, converter_out);
+
+ result = gst_pad_set_caps (sinkpad, sinkcaps);
+ g_print ("sink pad set caps %d, converter status: %d %d\n", result, converter_in, converter_out);
+
+ gst_caps_set (srccaps, "rate", GST_PROPS_INT (4000));
+ result = gst_pad_renegotiate (srcpad);
+ g_print ("sink pad renegotiate caps %d, converter status: %d %d\n", result, converter_in, converter_out);
+
+ gst_caps_set (srccaps, "rate", GST_PROPS_INT (40000));
+ result = gst_pad_set_caps (srcpad, srccaps);
+ g_print ("sink pad set caps %d, converter status: %d %d\n", result, converter_in, converter_out);
+
+ gst_caps_set (sinkcaps, "rate", GST_PROPS_INT (40000));
+ result = gst_pad_set_caps (sinkpad, sinkcaps);
+ g_print ("sink pad set caps %d, converter status: %d %d\n", result, converter_in, converter_out);
+
+ gst_caps_set (sinkcaps, "rate", GST_PROPS_INT (9000));
+ result = gst_pad_set_caps (sinkpad, sinkcaps);
+ g_print ("sink pad set caps %d, converter status: %d %d\n", result, converter_in, converter_out);
+
+ exit (!overall);
+}
parent = xmlNewChild (doc->xmlRootNode, NULL, "Props3", NULL);
gst_props_save_thyself (testprops, parent);
+ sinkprops = gst_props_set (sinkprops, "mpegtype", GST_PROPS_INT (1));
+ sinkprops = gst_props_set (sinkprops, "foobar", GST_PROPS_FOURCC_INT (0x56565656));
+
+ g_print ("%08lx\n", gst_props_get_fourcc_int (sinkprops, "foobar"));
+ g_print ("%d\n", gst_props_get_int (sinkprops, "mpegtype"));
+
+ parent = xmlNewChild (doc->xmlRootNode, NULL, "Props4", NULL);
+ gst_props_save_thyself (sinkprops, parent);
+
xmlDocDump(stdout, doc);
return 0;
--- /dev/null
+Makefile
+Makefile.in
+*.o
+*.lo
+*.la
+.deps
+.libs
+capsnego
+converter
--- /dev/null
+SUBDIRS =
+
+testprogs = capsnego converter
+
+TESTS = $(testprogs)
+
+check_PROGRAMS = $(testprogs)
+
+# we have nothing but apps here, we can do this safely
+LIBS += $(GST_LIBS)
+CFLAGS += $(GST_CFLAGS)
--- /dev/null
+
+#include <gst/gst.h>
+
+GstPad *srcpad, *sinkpad;
+GstPad *srcpadtempl, *sinkpadtempl;
+
+static GstPadFactory src_factory = {
+ "src",
+ GST_PAD_FACTORY_SRC,
+ GST_PAD_FACTORY_ALWAYS,
+ GST_PAD_FACTORY_CAPS(
+ "test_src",
+ "video/raw",
+ "height", GST_PROPS_INT_RANGE (16, 4096)
+ ),
+ NULL,
+};
+
+static GstPadFactory sink_factory = {
+ "sink",
+ GST_PAD_FACTORY_SINK,
+ GST_PAD_FACTORY_ALWAYS,
+ GST_PAD_FACTORY_CAPS(
+ "test_sink",
+ "video/raw",
+ "height", GST_PROPS_INT_RANGE (16, 8192)
+ ),
+ NULL,
+};
+
+static GstCapsFactory sink_caps = {
+ "sink_caps",
+ "video/raw",
+ "height", GST_PROPS_INT (3000),
+ NULL
+};
+
+static GstCapsFactory src_caps = {
+ "src_caps",
+ "video/raw",
+ "height", GST_PROPS_INT (3000),
+ NULL
+};
+
+static GstPadTemplate *srctempl, *sinktempl;
+static GstCaps *srccaps, *sinkcaps;
+
+static GstPadNegotiateReturn
+negotiate_src (GstPad *pad, GstCaps **caps, gint counter)
+{
+ g_print (">");
+
+ if (counter == 0) {
+ *caps = NULL;
+ return GST_PAD_NEGOTIATE_TRY;
+ }
+ if (*caps)
+ return GST_PAD_NEGOTIATE_AGREE;
+
+ return GST_PAD_NEGOTIATE_FAIL;
+}
+
+static GstPadNegotiateReturn
+negotiate_sink (GstPad *pad, GstCaps **caps, gint counter)
+{
+ g_print ("<");
+ if (counter == 0) {
+ *caps = NULL;
+ return GST_PAD_NEGOTIATE_TRY;
+ }
+ if (*caps)
+ return GST_PAD_NEGOTIATE_AGREE;
+
+ return GST_PAD_NEGOTIATE_FAIL;
+}
+
+static gboolean
+perform_check (void)
+{
+ gboolean result, overall = TRUE;
+
+ gint i, j;
+
+ g_print ("ABC: A=pad caps, B=pad template, C=negotiate function\n");
+
+ for (j=0; j<8; j++) {
+ GstPad *srctest, *sinktest;
+
+ for (i=0; i<8; i++) {
+
+ (j & 0x2 ? (sinktest = sinkpadtempl) : (sinktest = sinkpad));
+ (j & 0x4 ? (gst_pad_set_caps (sinktest, sinkcaps)) : (gst_pad_set_caps (sinktest, NULL)));
+ (j & 0x1 ? (gst_pad_set_negotiate_function (sinktest, negotiate_sink)) :
+ gst_pad_set_negotiate_function (sinktest, NULL));
+
+ (i & 0x2 ? (srctest = srcpadtempl) : (srctest = srcpad));
+ (i & 0x4 ? (gst_pad_set_caps (srctest, srccaps)) : (gst_pad_set_caps (srctest, NULL)));
+ (i & 0x1 ? (gst_pad_set_negotiate_function (srctest, negotiate_src)) :
+ gst_pad_set_negotiate_function (srctest, NULL));
+
+
+ g_print ("%d%d%d -> %d%d%d ..", (i&4)>>2, (i&2)>>1, i&1, (j&4)>>2, (j&2)>>1, j&1);
+ result = gst_pad_connect (srctest, sinktest);
+
+ g_print (".. %s\n", (result? "ok":"fail"));
+ if (result) gst_pad_disconnect (srctest, sinktest);
+
+ overall &= result;
+ }
+ }
+ return overall;
+}
+
+int
+main (int argc, char *argv[])
+{
+ gboolean overall = TRUE;
+
+ gst_init (&argc, &argv);
+
+ srcpad = gst_pad_new ("src", GST_PAD_SRC);
+ sinkpad = gst_pad_new ("sink", GST_PAD_SINK);
+
+ srctempl = gst_padtemplate_new (&src_factory);
+ sinktempl = gst_padtemplate_new (&sink_factory);
+
+ srcpadtempl = gst_pad_new_from_template (srctempl, "src");
+ sinkpadtempl = gst_pad_new_from_template (sinktempl, "sink");
+
+ sinkcaps = gst_caps_register (&sink_caps);
+ srccaps = gst_caps_register (&src_caps);
+
+ g_print ("*** compatible caps/templates ***\n");
+
+ overall &= perform_check ();
+
+ gst_caps_set (srccaps, "height", GST_PROPS_INT (9000));
+
+ g_print ("*** incompatible caps ***\n");
+ overall &= perform_check ();
+
+ exit (!overall);
+}
--- /dev/null
+
+#include <gst/gst.h>
+
+GstPad *srcpad, *sinkpad;
+GstPad *srcconvpad, *sinkconvpad;
+GstPad *srcpadtempl, *sinkpadtempl;
+GstPad *srcconvtempl, *sinkconvtempl;
+
+gint converter_in = -1, converter_out = -1;
+
+static GstPadFactory src_factory = {
+ "src",
+ GST_PAD_FACTORY_SRC,
+ GST_PAD_FACTORY_ALWAYS,
+ GST_PAD_FACTORY_CAPS(
+ "test_src",
+ "audio/raw",
+ "rate", GST_PROPS_INT_RANGE (16, 20000)
+ ),
+ NULL,
+};
+
+static GstPadFactory src_conv_factory = {
+ "src",
+ GST_PAD_FACTORY_SRC,
+ GST_PAD_FACTORY_ALWAYS,
+ GST_PAD_FACTORY_CAPS(
+ "test_src",
+ "audio/raw",
+ "rate", GST_PROPS_INT_RANGE (16, 20000)
+ ),
+ NULL,
+};
+
+static GstPadFactory sink_conv_factory = {
+ "src",
+ GST_PAD_FACTORY_SINK,
+ GST_PAD_FACTORY_ALWAYS,
+ GST_PAD_FACTORY_CAPS(
+ "test_src",
+ "audio/raw",
+ "rate", GST_PROPS_INT_RANGE (16, 20000)
+ ),
+ NULL,
+};
+
+static GstPadFactory sink_factory = {
+ "sink",
+ GST_PAD_FACTORY_SINK,
+ GST_PAD_FACTORY_ALWAYS,
+ GST_PAD_FACTORY_CAPS(
+ "test_sink",
+ "audio/raw",
+ "rate", GST_PROPS_INT_RANGE (16, 20000)
+ ),
+ NULL,
+};
+
+static GstCapsFactory sink_caps = {
+ "sink_caps",
+ "audio/raw",
+ "rate", GST_PROPS_INT (6000),
+ NULL
+};
+
+static GstCapsFactory src_caps = {
+ "src_caps",
+ "audio/raw",
+ "rate", GST_PROPS_INT (3000),
+ NULL
+};
+
+static GstPadTemplate *srctempl, *sinktempl;
+static GstCaps *srccaps, *sinkcaps;
+
+static GstPadNegotiateReturn
+negotiate_src (GstPad *pad, GstCaps **caps, gint counter)
+{
+ g_print (">");
+
+ if (counter == 0) {
+ *caps = NULL;
+ return GST_PAD_NEGOTIATE_TRY;
+ }
+ if (*caps) {
+ converter_out = gst_caps_get_int (*caps, "rate");
+ return GST_PAD_NEGOTIATE_AGREE;
+ }
+
+ return GST_PAD_NEGOTIATE_FAIL;
+}
+
+static GstPadNegotiateReturn
+negotiate_sink (GstPad *pad, GstCaps **caps, gint counter)
+{
+ g_print ("<");
+ if (counter == 0) {
+ *caps = NULL;
+ return GST_PAD_NEGOTIATE_TRY;
+ }
+ if (*caps) {
+ converter_in = gst_caps_get_int (*caps, "rate");
+ return GST_PAD_NEGOTIATE_AGREE;
+ }
+
+ return GST_PAD_NEGOTIATE_FAIL;
+}
+
+int
+main (int argc, char *argv[])
+{
+ gboolean overall = TRUE;
+ gboolean result;
+
+ gst_init (&argc, &argv);
+
+ srctempl = gst_padtemplate_new (&src_factory);
+ sinktempl = gst_padtemplate_new (&sink_factory);
+ srcpad = gst_pad_new_from_template (srctempl, "src");
+ sinkpad = gst_pad_new_from_template (sinktempl, "sink");
+
+ srcconvtempl = gst_padtemplate_new (&src_conv_factory);
+ sinkconvtempl = gst_padtemplate_new (&sink_conv_factory);
+ srcconvpad = gst_pad_new_from_template (srcconvtempl, "src");
+ sinkconvpad = gst_pad_new_from_template (sinkconvtempl, "sink");
+
+ gst_pad_set_negotiate_function (srcconvpad, negotiate_src);
+ gst_pad_set_negotiate_function (sinkconvpad, negotiate_sink);
+
+ sinkcaps = gst_caps_register (&sink_caps);
+ srccaps = gst_caps_register (&src_caps);
+ result = gst_pad_set_caps (srcpad, srccaps);
+ g_print ("set caps on src: %d\n", result);
+ g_print ("initial converter status: %d %d\n", converter_in, converter_out);
+
+ result = gst_pad_connect (srcpad, sinkconvpad);
+ g_print ("pad connect 1: %d\n", result);
+ overall &= (result == TRUE);
+ result = gst_pad_connect (srcconvpad, sinkpad);
+ g_print ("pad connect 2: %d\n", result);
+ overall &= (result == TRUE);
+
+ g_print ("after connect, converter status: %d %d\n", converter_in, converter_out);
+
+ result = gst_pad_set_caps (srcpad, srccaps);
+ g_print ("src pad set caps %d, converter status: %d %d\n", result, converter_in, converter_out);
+
+ result = gst_pad_set_caps (sinkpad, sinkcaps);
+ g_print ("sink pad set caps %d, converter status: %d %d\n", result, converter_in, converter_out);
+
+ gst_caps_set (srccaps, "rate", GST_PROPS_INT (4000));
+ result = gst_pad_renegotiate (srcpad);
+ g_print ("sink pad renegotiate caps %d, converter status: %d %d\n", result, converter_in, converter_out);
+
+ gst_caps_set (srccaps, "rate", GST_PROPS_INT (40000));
+ result = gst_pad_set_caps (srcpad, srccaps);
+ g_print ("sink pad set caps %d, converter status: %d %d\n", result, converter_in, converter_out);
+
+ gst_caps_set (sinkcaps, "rate", GST_PROPS_INT (40000));
+ result = gst_pad_set_caps (sinkpad, sinkcaps);
+ g_print ("sink pad set caps %d, converter status: %d %d\n", result, converter_in, converter_out);
+
+ gst_caps_set (sinkcaps, "rate", GST_PROPS_INT (9000));
+ result = gst_pad_set_caps (sinkpad, sinkcaps);
+ g_print ("sink pad set caps %d, converter status: %d %d\n", result, converter_in, converter_out);
+
+ exit (!overall);
+}